From d222edffe7f624c09afbed812c259af522b463a9 Mon Sep 17 00:00:00 2001
From: Derval Guillaume <gderval@uliege.be>
Date: Tue, 25 Jun 2024 13:35:03 +0200
Subject: [PATCH] Indices of variables should be RValues

---
 src/gboml/ast/variables.py | 2 +-
 src/gboml/parsing.py       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gboml/ast/variables.py b/src/gboml/ast/variables.py
index 6a1f094..8964a38 100644
--- a/src/gboml/ast/variables.py
+++ b/src/gboml/ast/variables.py
@@ -55,7 +55,7 @@ class IndexingParameterDefinition(Definition):
 @dataclass
 class VariableDefinition(NamedGBOMLObject):
     name: str
-    indices: list[str]
+    indices: list[RValue]
     scope: VarScope
     type: VarType
     bound_lower: Optional[Expression]
diff --git a/src/gboml/parsing.py b/src/gboml/parsing.py
index a875841..a6c8ff0 100644
--- a/src/gboml/parsing.py
+++ b/src/gboml/parsing.py
@@ -211,7 +211,7 @@ class GBOMLParser:
             def start(self, meta: Meta, time_horizon: Optional[int], global_defs: list[Definition], nodes_hyperedges: NodesAndHyperEdges):
                 return GBOMLGraph(time_horizon, global_defs, nodes_hyperedges.nodes, nodes_hyperedges.hyperedges, meta=meta)
 
-            def variable_definition(self, meta: Meta, scope: VarScope, type: Optional[VarType], names: list[(str, list[str])],
+            def variable_definition(self, meta: Meta, scope: VarScope, type: Optional[VarType], names: list[(str, list[RValue])],
                                     imports_from: Optional[list[VarOrParam]],
                                     bound_lower: Optional[Expression], bound_upper: Optional[Expression], tags: set[str]):
                 if imports_from is not None and len(imports_from) != len(names):
-- 
GitLab