You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/compiler/parse/state/text.js

19 lines
347 B

8 years ago
export default function text ( parser ) {
const start = parser.index;
let data = '';
while ( parser.index < parser.template.length && !parser.match( '<' ) && !parser.match( '{{' ) ) {
8 years ago
data += parser.template[ parser.index++ ];
}
parser.current().children.push({
start,
end: parser.index,
type: 'Text',
data
});
return null;
}