Skip to content
Snippets Groups Projects

Draft: Fortran Support

5 files
+ 39
29
Compare changes
  • Side-by-side
  • Inline

Files

+ 5
2
@@ -2,9 +2,10 @@
@@ -2,9 +2,10 @@
from __future__ import annotations
from __future__ import annotations
from typing_extensions import override
from typing_extensions import override
 
import re
from Infrastructure.Instruction import Instruction
from Infrastructure.Instruction import Instruction
from Infrastructure.Variables import ERROR_MARKER_COMMENT_BEGIN, ERROR_MARKER_COMMENT_END, ERROR_MARKER_COMMENT_BEGIN_FORT, ERROR_MARKER_COMMENT_END_FORT
from Infrastructure.Variables import ERROR_MARKER_COMMENT_BEGIN, ERROR_MARKER_COMMENT_END, ERROR_MARKER_COMMENT_BEGIN_FORT, ERROR_MARKER_COMMENT_END_FORT, adjust_var_language
import Infrastructure.Variables as infvars
import Infrastructure.Variables as infvars
asgn_template_c = """
asgn_template_c = """
@@ -43,10 +44,12 @@ class ArrAsgn(Instruction):
@@ -43,10 +44,12 @@ class ArrAsgn(Instruction):
@override
@override
def __str__(self):
def __str__(self):
actual_template = asgn_template_fort if infvars.generator_language == "fort" else asgn_template_c
actual_template = asgn_template_fort if infvars.generator_language == "fort" else asgn_template_c
 
actual_value = adjust_var_language(self._value)
 
s = (actual_template
s = (actual_template
.replace("@NAME@", self._arr_name)
.replace("@NAME@", self._arr_name)
.replace("@INDEX@", str(self._index))
.replace("@INDEX@", str(self._index))
.replace("@VALUE@", str(self._value)))
.replace("@VALUE@", actual_value))
if self._has_error:
if self._has_error:
if infvars.generator_language == "c":
if infvars.generator_language == "c":
Loading