summaryrefslogtreecommitdiff
path: root/src/compiler/parse/state/fragment.ts
blob: 27c5147412f9864b6b54129f9036968fb9143ce5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}