File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 44 test :
55 strategy :
66 matrix :
7- go-version : [1.16 .x]
7+ go-version : [1.21 .x]
88 os : [ubuntu-latest]
99 runs-on : ${{ matrix.os }}
1010 steps :
1616 uses : actions/checkout@v2
1717 - name : Install dependencies
1818 run : |
19- go get -u honnef.co/go/tools/cmd/staticcheck@latest
20- go get -u golang.org/x/tools/cmd/goimports
19+ go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
20+ go install golang.org/x/tools/cmd/goimports@v0.1.10
2121 - name : Run staticcheck
2222 run : staticcheck ./...
2323 - name : Check code formatting
Original file line number Diff line number Diff line change @@ -30,20 +30,20 @@ type StringNode struct {
3030}
3131
3232func parseString (p * parser , t token ) (Node , error ) {
33+ if t .Value == "" {
34+ return nil , newError (ErrSyntaxError , t )
35+ }
3336
3437 s , ok := unescape (t .Value )
3538 if ! ok {
3639 typ := ErrIllegalEscape
3740 if len (s ) > 0 && s [0 ] == 'u' {
3841 typ = ErrIllegalEscapeHex
3942 }
40-
4143 return nil , newErrorHint (typ , t , s )
4244 }
4345
44- return & StringNode {
45- Value : s ,
46- }, nil
46+ return & StringNode {Value : s }, nil
4747}
4848
4949func (n * StringNode ) optimize () (Node , error ) {
You can’t perform that action at this time.
0 commit comments