diff options
Diffstat (limited to 'parser')
| -rw-r--r-- | parser/README.md | 2 | ||||
| -rw-r--r-- | parser/expr.go | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/parser/README.md b/parser/README.md index 41a09a6..6f0f734 100644 --- a/parser/README.md +++ b/parser/README.md @@ -13,7 +13,7 @@ The input of parser is a list of tokens produced by the scanner. Multiple tokens are processed at once. The minimal set to get meaningful results (not an error or nil) is a complete statement. -The output of parser is also a list of tokens, to be consummed by +The output of parser is also a list of tokens, to be consumed by the compiler to produce bytecode. The output tokens set is identical to the bytecode instructions set except that: diff --git a/parser/expr.go b/parser/expr.go index e952f7c..0b2ad2a 100644 --- a/parser/expr.go +++ b/parser/expr.go @@ -1,6 +1,7 @@ package parser import ( + "fmt" "log" "strconv" @@ -97,6 +98,8 @@ func (p *Parser) ParseExpr(in Tokens) (out Tokens, err error) { out = append(out, t) vl++ ops = append(ops, scanner.Token{Str: "index", Id: lang.Index, Pos: t.Pos}) + default: + return nil, fmt.Errorf("expression not supported yet: %q", t.Str) } if len(selectors) > 0 { out = append(out, selectors...) |
