Skip to content

Commit 2feebde

Browse files
committed
Run gofmt -s
1 parent a43cfef commit 2feebde

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

parser.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
type associativity int
1010

1111
const (
12-
left associativity = iota + 1
12+
left associativity = iota + 1
1313
right
1414
)
1515

@@ -415,19 +415,19 @@ func (p *parser) parsePostfixExpression(node Node) (Node, error) {
415415
}
416416

417417
if token.kind != name &&
418-
// Operators like "not" and "matches" are valid method or property names,
419-
//
420-
// In other words, besides name token kind, operator kind could also be parsed as a property or method.
421-
// This is because operators are processed by the lexer prior to names. So "not" in "foo.not()"
422-
// or "matches" in "foo.matches" will be recognized as an operator first. But in fact, "not"
423-
// and "matches" in such expressions shall be parsed as method or property names.
424-
//
425-
// And this ONLY works if the operator consists of valid characters for a property or method name.
426-
//
427-
// Other types, such as text kind and number kind, can't be parsed as property nor method names.
428-
//
429-
// As a result, if token is NOT an operator OR token.value is NOT a valid property or method name,
430-
// an error shall be returned.
418+
// Operators like "not" and "matches" are valid method or property names,
419+
//
420+
// In other words, besides name token kind, operator kind could also be parsed as a property or method.
421+
// This is because operators are processed by the lexer prior to names. So "not" in "foo.not()"
422+
// or "matches" in "foo.matches" will be recognized as an operator first. But in fact, "not"
423+
// and "matches" in such expressions shall be parsed as method or property names.
424+
//
425+
// And this ONLY works if the operator consists of valid characters for a property or method name.
426+
//
427+
// Other types, such as text kind and number kind, can't be parsed as property nor method names.
428+
//
429+
// As a result, if token is NOT an operator OR token.value is NOT a valid property or method name,
430+
// an error shall be returned.
431431
(token.kind != operator || !isValidIdentifier(token.value)) {
432432
return nil, p.errorf("expected name")
433433
}

print_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package expr
22

33
import (
4-
"testing"
54
"fmt"
5+
"testing"
66
)
77

88
type printTest struct {

0 commit comments

Comments
 (0)