Run gofmt -s

This commit is contained in:
Anton Medvedev
2018-07-30 08:46:56 +03:00
parent 21322a6337
commit 0aa324ce3d
2 changed files with 15 additions and 15 deletions
+14 -14
View File
@@ -9,7 +9,7 @@ import (
type associativity int
const (
left associativity = iota + 1
left associativity = iota + 1
right
)
@@ -415,19 +415,19 @@ func (p *parser) parsePostfixExpression(node Node) (Node, error) {
}
if token.kind != name &&
// Operators like "not" and "matches" are valid method or property names,
//
// In other words, besides name token kind, operator kind could also be parsed as a property or method.
// This is because operators are processed by the lexer prior to names. So "not" in "foo.not()"
// or "matches" in "foo.matches" will be recognized as an operator first. But in fact, "not"
// and "matches" in such expressions shall be parsed as method or property names.
//
// And this ONLY works if the operator consists of valid characters for a property or method name.
//
// Other types, such as text kind and number kind, can't be parsed as property nor method names.
//
// As a result, if token is NOT an operator OR token.value is NOT a valid property or method name,
// an error shall be returned.
// Operators like "not" and "matches" are valid method or property names,
//
// In other words, besides name token kind, operator kind could also be parsed as a property or method.
// This is because operators are processed by the lexer prior to names. So "not" in "foo.not()"
// or "matches" in "foo.matches" will be recognized as an operator first. But in fact, "not"
// and "matches" in such expressions shall be parsed as method or property names.
//
// And this ONLY works if the operator consists of valid characters for a property or method name.
//
// Other types, such as text kind and number kind, can't be parsed as property nor method names.
//
// As a result, if token is NOT an operator OR token.value is NOT a valid property or method name,
// an error shall be returned.
(token.kind != operator || !isValidIdentifier(token.value)) {
return nil, p.errorf("expected name")
}
+1 -1
View File
@@ -1,8 +1,8 @@
package expr
import (
"testing"
"fmt"
"testing"
)
type printTest struct {