Answer architecture round 1: calls carry no operands in the grammar, ParseCalc returns its operands, one empty-segment check, sorted token kinds, and file items 110 and 111
This commit is contained in:
+2
-2
@@ -109,8 +109,8 @@ func fieldPathTo(t, target *template) ([]string, bool) {
|
||||
|
||||
// calcReads reports whether a calc reads spelling as one operand.
|
||||
func calcReads(spelling string) bool {
|
||||
n, err := grammar.ParseCalc(spelling)
|
||||
v, isVar := n.(grammar.CalcVar)
|
||||
c, err := grammar.ParseCalc(spelling)
|
||||
v, isVar := c.Expr.(grammar.CalcVar)
|
||||
return err == nil && isVar && v.Name == spelling
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user