-
-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
125 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
STRINGER_FILES = $(patsubst %.go,%_string.go,$(shell git grep //go:generate | grep "stringer" | cut -d ":" -f 1)) | ||
|
||
%_string.go: %.go | ||
go generate -run stringer $< | ||
|
||
.PHONY: .stringer | ||
.stringer: $(STRINGER_FILES) | ||
|
||
.PHONY: .stringer.clean | ||
.stringer.clean: | ||
find . \( -name *_string.go ! -path './vendor/*' \) -exec rm {} \; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
//go:generate stringer -type=Token $GOFILE | ||
|
||
/* | ||
* Copyright (C) 2016 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy ofthe License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specificlanguage governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package traversal | ||
|
||
// Token represents a lexical token. | ||
type Token int | ||
|
||
// Default language token, extension token start at 1000 | ||
const ( | ||
// Special tokens | ||
ILLEGAL Token = iota | ||
EOF | ||
WS | ||
|
||
// Literals | ||
IDENT | ||
|
||
// Misc characters | ||
COMMA | ||
DOT | ||
LEFTPARENTHESIS | ||
RIGHTPARENTHESIS | ||
STRING | ||
NUMBER | ||
|
||
// Keywords | ||
G | ||
V | ||
E | ||
HAS | ||
HASKEY | ||
HASNOT | ||
HASEITHER | ||
OUT | ||
IN | ||
OUTV | ||
INV | ||
BOTHV | ||
OUTE | ||
INE | ||
BOTHE | ||
DEDUP | ||
WITHIN | ||
WITHOUT | ||
METADATA | ||
SHORTESTPATHTO | ||
NE | ||
NEE | ||
BOTH | ||
CONTEXT | ||
REGEX | ||
LT | ||
GT | ||
LTE | ||
GTE | ||
INSIDE | ||
OUTSIDE | ||
BETWEEN | ||
COUNT | ||
RANGE | ||
LIMIT | ||
SORT | ||
VALUES | ||
KEYS | ||
SUM | ||
ASC | ||
DESC | ||
IPV4RANGE | ||
SUBGRAPH | ||
FOREVER | ||
NOW | ||
AS | ||
SELECT | ||
|
||
TRUE | ||
FALSE | ||
|
||
// extensions token have to start after 1000 | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters