diff --git a/src/lsp/util/lexers.ts b/src/lsp/util/lexers.ts index 65197b9..08727c8 100644 --- a/src/lsp/util/lexers.ts +++ b/src/lsp/util/lexers.ts @@ -3,31 +3,43 @@ import { lazy } from './lazy' const classAttributeStates: { [x: string]: moo.Rules } = { doubleClassList: { - lbrace: { match: /(? @@ -35,7 +47,7 @@ export const getClassAttributeLexer = lazy(() => main: { start1: { match: '"', push: 'doubleClassList' }, start2: { match: "'", push: 'singleClassList' }, - start3: { match: '{', push: 'interp' }, + start3: { match: '{', push: 'interpBrace' }, }, ...classAttributeStates, }) @@ -44,10 +56,10 @@ export const getClassAttributeLexer = lazy(() => export const getComputedClassAttributeLexer = lazy(() => moo.states({ main: { - quote: { match: /['"{]/, push: 'interp' }, + lbrace: { match: '{', push: 'interpBrace' }, + single: { match: "'", push: 'interpSingle' }, + double: { match: '"', push: 'interpDouble' }, }, - // TODO: really this should use a different interp definition that is - // terminated correctly based on the initial quote type ...classAttributeStates, }) )