Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaked parser for formatter #723

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.PHONY: build install compile test e2e doc fmt lint vet release
export CGO_ENABLED=0

DIR_BIN = ./bin
DIR_PKG = ./pkg
Expand All @@ -12,14 +13,14 @@ install:
go get

compile:
go build -race -v -o ${DIR_BIN}/ferret \
go build -v -o ${DIR_BIN}/ferret \
${DIR_E2E}/cli.go

test:
go test -race ${DIR_PKG}/...
go test ${DIR_PKG}/...

cover:
go test -race -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... && \
go test -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... && \
curl -s https://codecov.io/bash | bash

e2e:
Expand Down
2 changes: 1 addition & 1 deletion pkg/compiler/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ func (v *visitor) visitPropertyName(c fql.IPropertyNameContext, scope *scope) (c
return literals.NewStringLiteral(rw.GetText()), nil
}

if rw := ctx.UnsafReservedWord(); rw != nil {
if rw := ctx.UnsafeReservedWord(); rw != nil {
return literals.NewStringLiteral(rw.GetText()), nil
}

Expand Down
9 changes: 5 additions & 4 deletions pkg/parser/antlr/FqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ limitClause
;

limitClauseValue
: IntegerLiteral
: integerLiteral
| param
| variable
| functionCallExpression
Expand Down Expand Up @@ -171,6 +171,7 @@ timeoutClause

param
: Param Identifier
| Param safeReservedWord
;

variable
Expand Down Expand Up @@ -232,7 +233,7 @@ propertyName
| stringLiteral
| param
| safeReservedWord
| unsafReservedWord
| unsafeReservedWord
;

namespaceIdentifier
Expand Down Expand Up @@ -266,7 +267,7 @@ functionCall
functionName
: Identifier
| safeReservedWord
| unsafReservedWord
| unsafeReservedWord
;

argumentList
Expand Down Expand Up @@ -300,7 +301,7 @@ safeReservedWord
| Current
;

unsafReservedWord
unsafeReservedWord
: Return
| None
| Null
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/fql/FqlParser.interp

Large diffs are not rendered by default.

1,064 changes: 549 additions & 515 deletions pkg/parser/fql/fql_parser.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkg/parser/fql/fqlparser_base_listener.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/parser/fql/fqlparser_base_visitor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/parser/fql/fqlparser_listener.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/parser/fql/fqlparser_visitor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.