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/read/expression.js

16 lines
370 B

import { parseExpressionAt } from 'acorn';
export default function readExpression ( parser ) {
try {
const node = parseExpressionAt( parser.template, parser.index );
parser.index = node.end;
// TODO check it's a valid expression. probably shouldn't have
// [arrow] function expressions, etc
return node;
} catch ( err ) {
parser.acornError( err );
}
}