add parser support for expression lines.
This commit is contained in:
parent
1c0090e644
commit
fa4d1b8cc9
|
@ -46,12 +46,19 @@ export function parse_line (line) {
|
|||
};
|
||||
}
|
||||
|
||||
return parse_binding(line);
|
||||
const tokens = line.split(/\s+/g).filter(t => t.length > 0);
|
||||
|
||||
if (tokens.length >= 3 && tokens[1] === "=") {
|
||||
return parse_binding(tokens);
|
||||
}
|
||||
|
||||
return {
|
||||
type: Line.Expression,
|
||||
value: parse_expression(tokens),
|
||||
};
|
||||
}
|
||||
|
||||
function parse_binding (code) {
|
||||
const tokens = code.split(/\s+/g).filter(t => t.length > 0);
|
||||
|
||||
function parse_binding (tokens) {
|
||||
function invalid () {
|
||||
return {
|
||||
type: Line.Invalid,
|
||||
|
|
Loading…
Reference in New Issue