summaryrefslogtreecommitdiff
path: root/src/compiler/parse/state/fragment.ts
blob: a62748ae04cca2ece88b1953f28e831bf0081356 (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;
}