summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2020-09-17 11:00:54 +0200
committernsensfel <SpamShield0@noot-noot.org>2020-09-17 11:00:54 +0200
commit18aaf2fab1792a6f5448df7e00cc4cba5542fcf5 (patch)
tree3763b837a58be67fe84a60f0d18096a75dc4291f
parent60ed0ee5e2b4913aec9813b494d7cfa7747efdae (diff)
Resolves one of the grammar collisions.
-rw-r--r--src/core/src/tonkadur/fate/v1/parser/FateParser.g452
1 files changed, 45 insertions, 7 deletions
diff --git a/src/core/src/tonkadur/fate/v1/parser/FateParser.g4 b/src/core/src/tonkadur/fate/v1/parser/FateParser.g4
index 1d2213e..ab623a8 100644
--- a/src/core/src/tonkadur/fate/v1/parser/FateParser.g4
+++ b/src/core/src/tonkadur/fate/v1/parser/FateParser.g4
@@ -2248,23 +2248,60 @@ variable_list
returns [VariableList result]
@init
{
+ Type next_type;
+ Origin origin;
+
+ next_type = null;
+ origin = null;
+
$result = new VariableList();
}
:
(
WS*
- L_PAREN WS* type WS+ new_reference_name WS* R_PAREN
+ (
+ (
+ (
+ L_PAREN WS* type WS+
+ )
+ {
+ origin =
+ CONTEXT.get_origin_at
+ (
+ ($L_PAREN.getLine()),
+ ($L_PAREN.getCharPositionInLine())
+ );
+ next_type = ($type.result);
+ }
+ )
+ |
+ (
+ something_else=.
+ {
+ origin =
+ CONTEXT.get_origin_at
+ (
+ ($something_else.getLine()),
+ ($something_else.getCharPositionInLine())
+ );
+
+ next_type =
+ WORLD.types().get
+ (
+ origin,
+ ($something_else.text).substring(1).trim()
+ );
+ }
+ )
+ )
+ WS* new_reference_name WS* R_PAREN
{
$result.add
(
new Variable
(
- CONTEXT.get_origin_at
- (
- ($L_PAREN.getLine()),
- ($L_PAREN.getCharPositionInLine())
- ),
- ($type.result),
+ origin,
+ next_type,
($new_reference_name.result)
)
);
@@ -2272,6 +2309,7 @@ returns [VariableList result]
)*
{
}
+ |
;
catch [final Throwable e]
{