Introduce a =: operator

This commit is contained in:
Nigel Tao committed 2018-05-10 09:31:58 +10:00
1 parent 0a61b0cc44
commit 79aded4797
6 files changed
+12 -10

No files matched your search

+3 -3
View File
@@ -872,10 +872,10 @@ func (p *parser) parseVarNode(inIterate bool) (*a.Node, error) {
op := t.ID(0)
if inIterate {
op = t.IDColon
if x := p.peek1(); x != t.IDColon {
op = t.IDEqColon
if x := p.peek1(); x != t.IDEqColon {
got := p.tm.ByID(x)
return nil, fmt.Errorf(`parse: expected ":", got %q at %s:%d`, got, p.filename, p.line())
return nil, fmt.Errorf(`parse: expected "=:", got %q at %s:%d`, got, p.filename, p.line())
}
p.src = p.src[1:]
value, err = p.parseExpr()