diff options
Diffstat (limited to 'src/compiler/parse/state/fragment.ts')
-rw-r--r-- | src/compiler/parse/state/fragment.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/compiler/parse/state/fragment.ts b/src/compiler/parse/state/fragment.ts new file mode 100644 index 000000000..27c514741 --- /dev/null +++ b/src/compiler/parse/state/fragment.ts @@ -0,0 +1,16 @@ +import tag from './tag.js'; +import mustache from './mustache.js'; +import text from './text.js'; +import { Parser } from '../index.js'; + +export default function fragment(parser: Parser) { + if (parser.match('<')) { + return tag; + } + + if (parser.match('{')) { + return mustache; + } + + return text; +} |