File tree 3 files changed +13
-1
lines changed
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ import { IntermediateTokenizer } from "./intermediate-tokenizer"
47
47
import type { Tokenizer } from "./tokenizer"
48
48
import type { ParserOptions } from "../common/parser-options"
49
49
import { isSFCFile , getScriptParser } from "../common/parser-options"
50
+ // import type { Token } from "pug-lexer";
51
+ import lex from "pug-lexer" ;
50
52
51
53
const DIRECTIVE_NAME = / ^ (?: v - | [ . : @ # ] ) .* [ ^ . : @ # ] $ / u
52
54
const DT_DD = / ^ d [ d t ] $ / u
@@ -292,6 +294,14 @@ export class Parser {
292
294
}
293
295
this . postProcessesForScript = [ ]
294
296
297
+ // Process pug
298
+ const match = / < t e m p l a t e \s + l a n g = " p u g " > (?< content > .* ) < \/ t e m p l a t e > / isu. exec ( this . text )
299
+ if ( match && match . groups && match . groups . content ) {
300
+ const pugTokens = lex ( match . groups . content )
301
+ console . log ( pugTokens ) ;
302
+
303
+ }
304
+
295
305
return this . document
296
306
}
297
307
Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ export function parseForESLint(
93
93
template != null && ( templateLang === "html" || templateLang === "pug" )
94
94
? Object . assign ( template , concreteInfo )
95
95
: undefined
96
+ // if (templateLang === "pug")
97
+ // console.log(templateBody)
96
98
97
99
const scriptParser = getScriptParser ( options . parser , rootAST , "script" )
98
100
let scriptSetup : VElement | undefined
Original file line number Diff line number Diff line change 1
1
<template lang="pug">
2
- Hello !
2
+ p {{ greeting }} World !
3
3
</template >
You can’t perform that action at this time.
0 commit comments