Home / Function/ lexBinding() — vue Function Reference

lexBinding() — vue Function Reference

Architecture documentation for the lexBinding() function in cssVars.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  7e70476b_cf10_48c1_139d_32af0a9fe2f0["lexBinding()"]
  bb311256_82b1_7231_99fb_ad12d5f1f4fd["parseCssVars()"]
  bb311256_82b1_7231_99fb_ad12d5f1f4fd -->|calls| 7e70476b_cf10_48c1_139d_32af0a9fe2f0
  676a6c5d_6ef9_a6b7_ef84_83c833d8a8d4["cssVarsPlugin()"]
  676a6c5d_6ef9_a6b7_ef84_83c833d8a8d4 -->|calls| 7e70476b_cf10_48c1_139d_32af0a9fe2f0
  style 7e70476b_cf10_48c1_139d_32af0a9fe2f0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/cssVars.ts lines 69–104

function lexBinding(content: string, start: number): number | null {
  let state: LexerState = LexerState.inParens
  let parenDepth = 0

  for (let i = start; i < content.length; i++) {
    const char = content.charAt(i)
    switch (state) {
      case LexerState.inParens:
        if (char === `'`) {
          state = LexerState.inSingleQuoteString
        } else if (char === `"`) {
          state = LexerState.inDoubleQuoteString
        } else if (char === `(`) {
          parenDepth++
        } else if (char === `)`) {
          if (parenDepth > 0) {
            parenDepth--
          } else {
            return i
          }
        }
        break
      case LexerState.inSingleQuoteString:
        if (char === `'`) {
          state = LexerState.inParens
        }
        break
      case LexerState.inDoubleQuoteString:
        if (char === `"`) {
          state = LexerState.inParens
        }
        break
    }
  }
  return null
}

Domain

Subdomains

Frequently Asked Questions

What does lexBinding() do?
lexBinding() is a function in the vue codebase.
What calls lexBinding()?
lexBinding() is called by 2 function(s): cssVarsPlugin, parseCssVars.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free