Fix expandMacro calls to explicitly pass 'subs' parameter recursively

The hack on which expandMacro parameters used to rely on, resulted in a side-
effect, namely that once passed expandMacro parameter is available
recursively, until overridden.
With new contract all parameters need to be passed on when an expandMacro
is called recursively.
This commit is contained in:
Fedor Isakov 2021-09-21 16:18:04 +02:00
parent 3f606ba63c
commit ec6e56c1c3
4 changed files with 108 additions and 0 deletions

View File

@ -111,6 +111,14 @@
<reference id="6097203247182937177" name="template" index="3jbY9l" />
<child id="6097203247182937145" name="input" index="3jbY8P" />
<child id="6097203247182937143" name="logical" index="3jbY8V" />
<child id="6097203247185615297" name="arglist" index="3jhGvd" />
</concept>
<concept id="6097203247185614706" name="jetbrains.mps.lang.coderules.structure.ExpandMacroConstraintArglist" flags="ng" index="3jhG_Y">
<child id="6097203247185614855" name="binding" index="3jhGob" />
</concept>
<concept id="6097203247185614707" name="jetbrains.mps.lang.coderules.structure.ExpandMacroConstraintArgBinding" flags="ng" index="3jhG_Z">
<reference id="6097203247185614710" name="declaration" index="3jhG_U" />
<child id="6097203247185614708" name="argument" index="3jhG_S" />
</concept>
<concept id="6097203247184206287" name="jetbrains.mps.lang.coderules.structure.CallMacroConstraint" flags="ng" index="3jm4v3">
<reference id="6097203247184207800" name="template" index="3jm46O" />
@ -201,6 +209,14 @@
<node concept="a7P8L" id="1oUE7CX4epE" role="3jbY8V">
<ref role="a7OzE" node="1oUE7CX4eol" resolve="Type" />
</node>
<node concept="3jhG_Y" id="6cGbuqP0Be8" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP0BSb" role="3jhGob">
<ref role="3jhG_U" to="kqnc:5itBwMaLICh" resolve="substitution" />
<node concept="3hN9Ij" id="6cGbuqP0BSf" role="3jhG_S">
<ref role="3hLkJx" node="1oUE7CXkYVc" resolve="subs" />
</node>
</node>
</node>
</node>
</node>
</node>

View File

@ -15799,6 +15799,14 @@
<node concept="a7P8L" id="5itBwMayP19" role="3jbY8V">
<ref role="a7OzE" node="5itBwMayP0g" resolve="Param" />
</node>
<node concept="3jhG_Y" id="6cGbuqP1rvp" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP1rvr" role="3jhGob">
<ref role="3jhG_U" node="5itBwMaLICh" resolve="substitution" />
<node concept="3i2tpf" id="6cGbuqP1rvv" role="3jhG_S">
<ref role="3i285M" node="5itBwMaLICh" resolve="substitution" />
</node>
</node>
</node>
</node>
</node>
<node concept="3Aqczg" id="4MEOIDEwTgI" role="3cqZAp">
@ -15854,6 +15862,14 @@
<node concept="a7P8L" id="5itBwMayPB6" role="3jbY8V">
<ref role="a7OzE" node="5itBwMayPAw" resolve="Bnd" />
</node>
<node concept="3jhG_Y" id="6cGbuqP1r_f" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP1r_h" role="3jhGob">
<ref role="3jhG_U" node="5itBwMaLICh" resolve="substitution" />
<node concept="3i2tpf" id="6cGbuqP1r_l" role="3jhG_S">
<ref role="3i285M" node="5itBwMaLICh" resolve="substitution" />
</node>
</node>
</node>
</node>
</node>
<node concept="3Aqczg" id="4MEOIDEwTno" role="3cqZAp">
@ -15909,6 +15925,14 @@
<node concept="a7P8L" id="5itBwMayQ6L" role="3jbY8V">
<ref role="a7OzE" node="5itBwMayQ73" resolve="Bnd" />
</node>
<node concept="3jhG_Y" id="6cGbuqP1r_q" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP1r_s" role="3jhGob">
<ref role="3jhG_U" node="5itBwMaLICh" resolve="substitution" />
<node concept="3i2tpf" id="6cGbuqP1r_w" role="3jhG_S">
<ref role="3i285M" node="5itBwMaLICh" resolve="substitution" />
</node>
</node>
</node>
</node>
</node>
<node concept="3Aqczg" id="5itBwMayQ6M" role="3cqZAp">
@ -15961,6 +15985,14 @@
<node concept="a7P8L" id="6BYZfeEXakf" role="3jbY8V">
<ref role="a7OzE" node="6BYZfeEXak1" resolve="Bnd" />
</node>
<node concept="3jhG_Y" id="6cGbuqP1rA3" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP1rA5" role="3jhGob">
<ref role="3jhG_U" node="5itBwMaLICh" resolve="substitution" />
<node concept="3i2tpf" id="6cGbuqP1rA9" role="3jhG_S">
<ref role="3i285M" node="5itBwMaLICh" resolve="substitution" />
</node>
</node>
</node>
</node>
</node>
<node concept="3Aqczg" id="6BYZfeEZLJq" role="3cqZAp">
@ -30843,6 +30875,12 @@
</node>
</node>
<node concept="3jhG_Y" id="6BYZfeEX8Uo" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqOX83b" role="3jhGob">
<ref role="3jhG_U" node="5itBwMaLICh" resolve="substitution" />
<node concept="3hN9Ij" id="6cGbuqOX83l" role="3jhG_S">
<ref role="3hLkJx" node="5itBwMb1_Cj" resolve="subs" />
</node>
</node>
<node concept="3jhG_Z" id="6BYZfeEX8Uq" role="3jhGob">
<ref role="3jhG_U" node="6BYZfeEX8SG" resolve="bound" />
<node concept="2OqwBi" id="6BYZfeEX99M" role="3jhG_S">
@ -31424,6 +31462,14 @@
<node concept="a7P8L" id="6GOqnFkhy$P" role="3jbY8V">
<ref role="a7OzE" node="6GOqnFkhyyQ" resolve="Bound" />
</node>
<node concept="3jhG_Y" id="6cGbuqP0NFS" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP0NFU" role="3jhGob">
<ref role="3jhG_U" node="5itBwMaLICh" resolve="substitution" />
<node concept="3hN9Ij" id="6cGbuqP0NFY" role="3jhG_S">
<ref role="3hLkJx" node="6GOqnFkhyzx" resolve="subs" />
</node>
</node>
</node>
</node>
</node>
</node>

View File

@ -220,6 +220,9 @@
</concept>
<concept id="5042557354438383712" name="jetbrains.mps.lang.coderules.structure.TermListType" flags="ig" index="VbTHi" />
<concept id="2381360340662937504" name="jetbrains.mps.lang.coderules.structure.TermType" flags="ig" index="32pEOW" />
<concept id="6097203247164180547" name="jetbrains.mps.lang.coderules.structure.ExpandMacroParameterReference" flags="ng" index="3i2tpf">
<reference id="6097203247164235646" name="declaration" index="3i285M" />
</concept>
<concept id="6097203247156088058" name="jetbrains.mps.lang.coderules.structure.ExpandMacroInputSpecification" flags="ng" index="3ixlbQ">
<reference id="6097203247156276310" name="applicableConcept" index="3ixz9q" />
<child id="6097203247156107501" name="input" index="3ix8rx" />
@ -239,6 +242,14 @@
<reference id="6097203247182937177" name="template" index="3jbY9l" />
<child id="6097203247182937145" name="input" index="3jbY8P" />
<child id="6097203247182937143" name="logical" index="3jbY8V" />
<child id="6097203247185615297" name="arglist" index="3jhGvd" />
</concept>
<concept id="6097203247185614706" name="jetbrains.mps.lang.coderules.structure.ExpandMacroConstraintArglist" flags="ng" index="3jhG_Y">
<child id="6097203247185614855" name="binding" index="3jhGob" />
</concept>
<concept id="6097203247185614707" name="jetbrains.mps.lang.coderules.structure.ExpandMacroConstraintArgBinding" flags="ng" index="3jhG_Z">
<reference id="6097203247185614710" name="declaration" index="3jhG_U" />
<child id="6097203247185614708" name="argument" index="3jhG_S" />
</concept>
<concept id="3575255234174969639" name="jetbrains.mps.lang.coderules.structure.ConstraintRule" flags="ng" index="1nLNMm">
<child id="4814011019633607808" name="parameter" index="0Rg$4" />
@ -381,6 +392,14 @@
<ref role="3cqZAo" node="6T3vXgtMzd2" resolve="i" />
</node>
</node>
<node concept="3jhG_Y" id="6cGbuqP1_LU" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP1_LW" role="3jhGob">
<ref role="3jhG_U" to="kqnc:5itBwMaLICh" resolve="substitution" />
<node concept="3i2tpf" id="6cGbuqP1_M0" role="3jhG_S">
<ref role="3i285M" to="kqnc:5itBwMaLICh" resolve="substitution" />
</node>
</node>
</node>
</node>
</node>
</node>
@ -487,6 +506,14 @@
<ref role="3cqZAo" node="6T3vXgtM$kA" resolve="i" />
</node>
</node>
<node concept="3jhG_Y" id="6cGbuqP1_M8" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP1_Ma" role="3jhGob">
<ref role="3jhG_U" to="kqnc:5itBwMaLICh" resolve="substitution" />
<node concept="3i2tpf" id="6cGbuqP1_Me" role="3jhG_S">
<ref role="3i285M" to="kqnc:5itBwMaLICh" resolve="substitution" />
</node>
</node>
</node>
</node>
</node>
</node>

View File

@ -223,6 +223,9 @@
<child id="6856711987714624233" name="code" index="HKQng" />
</concept>
<concept id="2381360340662937504" name="jetbrains.mps.lang.coderules.structure.TermType" flags="ig" index="32pEOW" />
<concept id="6097203247164180547" name="jetbrains.mps.lang.coderules.structure.ExpandMacroParameterReference" flags="ng" index="3i2tpf">
<reference id="6097203247164235646" name="declaration" index="3i285M" />
</concept>
<concept id="6097203247156088058" name="jetbrains.mps.lang.coderules.structure.ExpandMacroInputSpecification" flags="ng" index="3ixlbQ">
<reference id="6097203247156276310" name="applicableConcept" index="3ixz9q" />
<child id="6097203247156107501" name="input" index="3ix8rx" />
@ -242,6 +245,14 @@
<reference id="6097203247182937177" name="template" index="3jbY9l" />
<child id="6097203247182937145" name="input" index="3jbY8P" />
<child id="6097203247182937143" name="logical" index="3jbY8V" />
<child id="6097203247185615297" name="arglist" index="3jhGvd" />
</concept>
<concept id="6097203247185614706" name="jetbrains.mps.lang.coderules.structure.ExpandMacroConstraintArglist" flags="ng" index="3jhG_Y">
<child id="6097203247185614855" name="binding" index="3jhGob" />
</concept>
<concept id="6097203247185614707" name="jetbrains.mps.lang.coderules.structure.ExpandMacroConstraintArgBinding" flags="ng" index="3jhG_Z">
<reference id="6097203247185614710" name="declaration" index="3jhG_U" />
<child id="6097203247185614708" name="argument" index="3jhG_S" />
</concept>
<concept id="6097203247184206287" name="jetbrains.mps.lang.coderules.structure.CallMacroConstraint" flags="ng" index="3jm4v3">
<reference id="6097203247184207800" name="template" index="3jm46O" />
@ -2408,6 +2419,14 @@
<node concept="a7P8L" id="6Dg__VK8zqf" role="3jbY8V">
<ref role="a7OzE" node="6Dg__VK8zef" resolve="DType" />
</node>
<node concept="3jhG_Y" id="6cGbuqP1B3X" role="3jhGvd">
<node concept="3jhG_Z" id="6cGbuqP1B3Z" role="3jhGob">
<ref role="3jhG_U" to="kqnc:5itBwMaLICh" resolve="substitution" />
<node concept="3i2tpf" id="6cGbuqP1B43" role="3jhG_S">
<ref role="3i285M" to="kqnc:5itBwMaLICh" resolve="substitution" />
</node>
</node>
</node>
</node>
</node>
<node concept="3Aqczg" id="6Dg__VK8zR5" role="3cqZAp">