0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-24 23:21:57 -05:00
astro/src/compiler/parse/state/fragment.ts
2021-03-23 20:15:44 -07:00

21 lines
388 B
TypeScript

import tag from './tag.js';
import setup from './setup.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 setup;
}
if (parser.match('<')) {
return tag;
}
if (parser.match('{')) {
return mustache;
}
return text;
}