Skip to content

Commit 93fabf3

Browse files
committed
Use variables instead of constants in some rules
1 parent 83544aa commit 93fabf3

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

MyParser.g4

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ expression
9292
;
9393

9494
specialMatrixFunction
95-
: EYE OPEN_BRACKET_ROUND int CLOSE_BRACKET_ROUND
96-
| (ZEROS | ONES) OPEN_BRACKET_ROUND int (COMMA int)* CLOSE_BRACKET_ROUND
95+
: EYE OPEN_BRACKET_ROUND expression CLOSE_BRACKET_ROUND
96+
| (ZEROS | ONES) OPEN_BRACKET_ROUND expression (COMMA expression)* CLOSE_BRACKET_ROUND
9797
;
9898

9999
break
@@ -109,7 +109,7 @@ vector
109109
;
110110

111111
elementReference
112-
: id OPEN_BRACKET_SQUARE int (COMMA int)* CLOSE_BRACKET_SQUARE
112+
: id OPEN_BRACKET_SQUARE expression (COMMA expression)* CLOSE_BRACKET_SQUARE
113113
;
114114

115115
id

generated/MyParser.interp

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/MyParser.py

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)