This repository was archived by the owner on Dec 10, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ const double DOUBLE_CONST = 123.456
8
8
const string DOUBLE_QUOTED_CONST = " hello"
9
9
const string SINGLE_QUOTED_CONST = ' hello'
10
10
11
+ const string CONST_WITH_SEP1 = " hello" ,
12
+ const string CONST_WITH_SEP2 = " hello" ;
13
+
11
14
const list < i32 > I32_LIST_CONST = [1 , 2 , 3 ]
12
15
const list < double > DOUBLE_LIST_CONST = [1.1 , 2.2 , 3.3 ]
13
16
const list < string > STRING_LIST_CONST = [" hello" , " world" ]
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ def test_string_const():
20
20
assert "hello" == const .SINGLE_QUOTED_CONST
21
21
22
22
23
+ def test_const_with_sep ():
24
+ assert "hello" == const .CONST_WITH_SEP1
25
+ assert "hello" == const .CONST_WITH_SEP2
26
+
27
+
23
28
def test_list_const ():
24
29
assert [1 , 2 , 3 ] == const .I32_LIST_CONST
25
30
assert [1.1 , 2.2 , 3.3 ] == const .DOUBLE_LIST_CONST
Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ def p_definition_unit(p):
91
91
92
92
93
93
def p_const (p ):
94
- '''const : CONST field_type IDENTIFIER '=' const_value'''
94
+ '''const : CONST field_type IDENTIFIER '=' const_value
95
+ | CONST field_type IDENTIFIER '=' const_value sep'''
95
96
96
97
try :
97
98
val = _cast (p [2 ])(p [5 ])
You can’t perform that action at this time.
0 commit comments