Skip to content

Commit 94bed1b

Browse files
committed
remove , from identifiers
1 parent 1e9fe62 commit 94bed1b

8 files changed

Lines changed: 11 additions & 24 deletions

File tree

meta/src/meta/grammar.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
%token INT Int64 r'[-]?\d+'
4141
%token INT128 logic.Int128Value r'[-]?\d+i128'
4242
%token STRING String r'"(?:[^"\\]|\\.)*"'
43-
%token SYMBOL String r'[a-zA-Z_][a-zA-Z0-9_./#,-]*'
43+
%token SYMBOL String r'[a-zA-Z_][a-zA-Z0-9_./#-]*'
4444
%token UINT128 logic.UInt128Value r'0x[0-9a-fA-F]+'
4545

4646
# Type declarations for rules

sdks/go/src/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ var (
145145
{"INT", regexp.MustCompile(`^[-]?\d+`), func(s string) TokenValue { return TokenValue{kind: kindInt64, i64: scanInt(s)} }},
146146
{"INT128", regexp.MustCompile(`^[-]?\d+i128`), func(s string) TokenValue { return TokenValue{kind: kindInt128, int128: scanInt128(s)} }},
147147
{"STRING", regexp.MustCompile(`^"(?:[^"\\]|\\.)*"`), func(s string) TokenValue { return TokenValue{kind: kindString, str: scanString(s)} }},
148-
{"SYMBOL", regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_./#,-]*`), func(s string) TokenValue { return TokenValue{kind: kindString, str: scanSymbol(s)} }},
148+
{"SYMBOL", regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_./#-]*`), func(s string) TokenValue { return TokenValue{kind: kindString, str: scanSymbol(s)} }},
149149
{"UINT128", regexp.MustCompile(`^0x[0-9a-fA-F]+`), func(s string) TokenValue { return TokenValue{kind: kindUint128, uint128: scanUint128(s)} }},
150150
}
151151
)

sdks/julia/LogicalQueryProtocol.jl/src/parser.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const _TOKEN_SPECS = [
153153
("INT", r"[-]?\d+", scan_int),
154154
("INT128", r"[-]?\d+i128", scan_int128),
155155
("STRING", r"\"(?:[^\"\\]|\\.)*\"", scan_string),
156-
("SYMBOL", r"[a-zA-Z_][a-zA-Z0-9_./#,-]*", scan_symbol),
156+
("SYMBOL", r"[a-zA-Z_][a-zA-Z0-9_./#-]*", scan_symbol),
157157
("UINT128", r"0x[0-9a-fA-F]+", scan_uint128),
158158
]
159159

sdks/python/src/lqp/gen/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def __repr__(self) -> str:
115115
("STRING", re.compile(r'"(?:[^"\\]|\\.)*"'), lambda x: Lexer.scan_string(x)),
116116
(
117117
"SYMBOL",
118-
re.compile(r"[a-zA-Z_][a-zA-Z0-9_./#,-]*"),
118+
re.compile(r"[a-zA-Z_][a-zA-Z0-9_./#-]*"),
119119
lambda x: Lexer.scan_symbol(x),
120120
),
121121
("UINT128", re.compile(r"0x[0-9a-fA-F]+"), lambda x: Lexer.scan_uint128(x)),

tests/bin/special_chars_in_ids.bin

-139 Bytes
Binary file not shown.

tests/lqp/special_chars_in_ids.lqp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;; Test that identifiers can contain / # and , characters
1+
;; Test that identifiers can contain / # characters
22
(transaction
33
(epoch
44
(writes
@@ -13,11 +13,7 @@
1313
([x::INT y::INT]
1414
(and
1515
(atom :my/relation x)
16-
(= y x))))
17-
(def :my,relation
18-
([x::INT]
19-
(atom :my/relation x))))))
16+
(= y x)))))))
2017
(reads
2118
(output :my/relation :my/relation)
22-
(output :my#relation :my#relation)
23-
(output :my,relation :my,relation))))
19+
(output :my#relation :my#relation))))

tests/pretty/special_chars_in_ids.lqp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,5 @@
66
(fragment
77
:f1
88
(def :my/relation ([x::INT] (and (= x 1) (atom :other/rel x x))))
9-
(def :my#relation ([x::INT y::INT] (and (atom :my/relation x) (= y x))))
10-
(def :my,relation ([x::INT] (atom :my/relation x))))))
11-
(reads
12-
(output :my/relation :my/relation)
13-
(output :my#relation :my#relation)
14-
(output :my,relation :my,relation))))
9+
(def :my#relation ([x::INT y::INT] (and (atom :my/relation x) (= y x)))))))
10+
(reads (output :my/relation :my/relation) (output :my#relation :my#relation))))

tests/pretty_debug/special_chars_in_ids.lqp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,14 @@
1010
([x::INT] (and (= x 1) (atom 0x91b51012f825fc7c589f890a3b18cfd4 x x))))
1111
(def
1212
0x1e9de369d8c3c11ff417a9c0c86e7ebe
13-
([x::INT y::INT] (and (atom 0x15c3d261e9b87ddca0f3e13e054457bd x) (= y x))))
14-
(def
15-
0xcdd1079222948b600fa246777af00460
16-
([x::INT] (atom 0x15c3d261e9b87ddca0f3e13e054457bd x))))))
13+
([x::INT y::INT] (and (atom 0x15c3d261e9b87ddca0f3e13e054457bd x) (= y x)))))))
1714
(reads
1815
(output :my/relation 0x15c3d261e9b87ddca0f3e13e054457bd)
19-
(output :my#relation 0x1e9de369d8c3c11ff417a9c0c86e7ebe)
20-
(output :my,relation 0xcdd1079222948b600fa246777af00460))))
16+
(output :my#relation 0x1e9de369d8c3c11ff417a9c0c86e7ebe))))
2117

2218
;; Debug information
2319
;; -----------------------
2420
;; Original names
2521
;; ID `0x1e9de369d8c3c11ff417a9c0c86e7ebe` -> `my#relation`
26-
;; ID `0xcdd1079222948b600fa246777af00460` -> `my,relation`
2722
;; ID `0x15c3d261e9b87ddca0f3e13e054457bd` -> `my/relation`
2823
;; ID `0x91b51012f825fc7c589f890a3b18cfd4` -> `other/rel`

0 commit comments

Comments
 (0)