Skip to content

Commit

Permalink
Allow negative numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhoerstr committed Apr 30, 2024
1 parent a7e04a1 commit ab57358
Show file tree
Hide file tree
Showing 2 changed files with 276 additions and 266 deletions.
27 changes: 12 additions & 15 deletions pfdl_grammar/PFDLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ condition_failed:
FAILED INDENT statement+ DEDENT;

parameter:
STARTS_WITH_LOWER_C_STR
| attribute_access;
STARTS_WITH_LOWER_C_STR | attribute_access;

struct_initialization:
STARTS_WITH_UPPER_C_STR INDENT json_object NL+ DEDENT
Expand All @@ -84,9 +83,7 @@ attribute_access:
array:
ARRAY_LEFT (INTEGER | STARTS_WITH_LOWER_C_STR)? ARRAY_RIGHT;

number:
INTEGER
| FLOAT;
number: MINUS? (INTEGER | FLOAT);

value:
TRUE
Expand Down Expand Up @@ -130,13 +127,13 @@ json_open_bracket:
JSON_OPEN | JSON_OPEN_2;

json_value:
JSON_STRING
| JSON_TRUE
| JSON_FALSE
| NUMBER
| json_object
| json_array;

json_array
: JSON_ARRAY_LEFT json_value (JSON_COMMA json_value)* JSON_ARRAY_RIGHT
| JSON_ARRAY_LEFT JSON_ARRAY_RIGHT;
JSON_STRING
| JSON_TRUE
| JSON_FALSE
| NUMBER
| json_object
| json_array;

json_array:
JSON_ARRAY_LEFT json_value (JSON_COMMA json_value)* JSON_ARRAY_RIGHT
| JSON_ARRAY_LEFT JSON_ARRAY_RIGHT;
Loading

0 comments on commit ab57358

Please sign in to comment.