mirror of https://github.com/sveltejs/svelte
parent
43c257b62e
commit
a08cb44377
@ -1,11 +1,15 @@
|
||||
import { parseExpressionAt } from 'acorn';
|
||||
|
||||
export default function readExpression ( parser ) {
|
||||
const node = parseExpressionAt( parser.template, parser.index );
|
||||
parser.index = node.end;
|
||||
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
|
||||
// TODO check it's a valid expression. probably shouldn't have
|
||||
// [arrow] function expressions, etc
|
||||
|
||||
return node;
|
||||
return node;
|
||||
} catch ( err ) {
|
||||
parser.acornError( err );
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
export default function spaces ( i ) {
|
||||
let result = '';
|
||||
while ( i-- ) result += ' ';
|
||||
return result;
|
||||
}
|
Loading…
Reference in new issue