Skip to content

Commit

Permalink
Merge pull request #1074 from IETS3/feature/numbers_in_hex_format
Browse files Browse the repository at this point in the history
core.expr: implement hex numbers
  • Loading branch information
arimer authored Oct 16, 2024
2 parents fa42d82 + 17f3076 commit 57b05c8
Show file tree
Hide file tree
Showing 28 changed files with 5,055 additions and 536 deletions.
11 changes: 3 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,17 @@ The project does _not_ follow Semantic Versioning and the changes are documented
### Added

- The extension point `IUnitLangConfig` has a new method useSlashInsteadOfDivisionSymbol that allows to replace the "÷" character in unit names with the more common "/" character.
- Number literals, collection size specifications and number range specifications now support entering numbers in hexadecimal format. This feature can be activated through PrimitiveTypeMapper#allowHexadecimalNumbers.
- Collection size and number range specifications now initialize with an infinite range by default. Setting the min and max field therefore is equal to setting them to infinity.

## August 2024

### Added

- The name of the unitless unit can now be customized through the `PhysUnitLangConfig` extension point.

### Fixed

- The name of the unitless unit can now be customized through the `PhysUnitLangConfig` extension point.

### Fixed

- TraceExplorer can decorate editors of lambda nodes with their values.
- The code completion of the new unit language was improved.
- The performance of error type propagation (especially in relation to type tags) was improved.
- The name of the unitless unit can now be customized through the `PhysUnitLangConfig` extension point.

## July 2024

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<use id="7866978e-a0f0-4cc7-81bc-4d213d9375e1" name="jetbrains.mps.lang.smodel" version="19" />
<use id="f2801650-65d5-424e-bb1b-463a8781b786" name="jetbrains.mps.baseLanguage.javadoc" version="-1" />
<use id="83888646-71ce-4f1c-9c53-c54016f6ad4f" name="jetbrains.mps.baseLanguage.collections" version="1" />
<use id="fd392034-7849-419d-9071-12563d152375" name="jetbrains.mps.baseLanguage.closures" version="0" />
<use id="3a13115c-633c-4c5c-bbcc-75c4219e9555" name="jetbrains.mps.lang.quotation" version="5" />
<devkit ref="fbc25dd2-5da4-483a-8b19-70928e1b62d7(jetbrains.mps.devkit.general-purpose)" />
</languages>
<imports>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<persistence version="9" />
<languages>
<use id="7a5dda62-9140-4668-ab76-d5ed1746f2b2" name="jetbrains.mps.lang.typesystem" version="-1" />
<use id="3f4bc5f5-c6c1-4a28-8b10-c83066ffa4a1" name="jetbrains.mps.lang.constraints" version="6" />
<use id="f3061a53-9226-4cc5-a443-f952ceaf5816" name="jetbrains.mps.baseLanguage" version="12" />
<use id="7866978e-a0f0-4cc7-81bc-4d213d9375e1" name="jetbrains.mps.lang.smodel" version="19" />
<devkit ref="00000000-0000-4000-0000-5604ebd4f22c(jetbrains.mps.devkit.aspect.constraints)" />
</languages>
<imports>
Expand Down Expand Up @@ -80,16 +83,23 @@
<concept id="6702802731807351367" name="jetbrains.mps.lang.constraints.structure.ConstraintFunction_CanBeAChild" flags="in" index="9S07l" />
<concept id="1202989658459" name="jetbrains.mps.lang.constraints.structure.ConstraintFunctionParameter_parentNode" flags="nn" index="nLn13" />
<concept id="8966504967485224688" name="jetbrains.mps.lang.constraints.structure.ConstraintFunctionParameter_contextNode" flags="nn" index="2rP1CM" />
<concept id="1147467115080" name="jetbrains.mps.lang.constraints.structure.NodePropertyConstraint" flags="ng" index="EnEH3">
<reference id="1147467295099" name="applicableProperty" index="EomxK" />
<child id="1212097481299" name="propertyValidator" index="QCWH9" />
</concept>
<concept id="1212096972063" name="jetbrains.mps.lang.constraints.structure.ConstraintFunction_PropertyValidator" flags="in" index="QB0g5" />
<concept id="5564765827938091039" name="jetbrains.mps.lang.constraints.structure.ConstraintFunction_ReferentSearchScope_Scope" flags="ig" index="3dgokm" />
<concept id="1213093968558" name="jetbrains.mps.lang.constraints.structure.ConceptConstraints" flags="ng" index="1M2fIO">
<reference id="1213093996982" name="concept" index="1M2myG" />
<child id="6702802731807737306" name="canBeChild" index="9Vyp8" />
<child id="1213098023997" name="property" index="1MhHOB" />
<child id="1213100494875" name="referent" index="1Mr941" />
</concept>
<concept id="1148687176410" name="jetbrains.mps.lang.constraints.structure.NodeReferentConstraint" flags="ng" index="1N5Pfh">
<reference id="1148687202698" name="applicableLink" index="1N5Vy1" />
<child id="1148687345559" name="searchScopeFactory" index="1N6uqs" />
</concept>
<concept id="1153138554286" name="jetbrains.mps.lang.constraints.structure.ConstraintsFunctionParameter_propertyValue" flags="nn" index="1Wqviy" />
</language>
<language id="fd392034-7849-419d-9071-12563d152375" name="jetbrains.mps.baseLanguage.closures">
<concept id="1199569711397" name="jetbrains.mps.baseLanguage.closures.structure.ClosureLiteral" flags="nn" index="1bVj0M">
Expand Down Expand Up @@ -1152,5 +1162,27 @@
</node>
</node>
</node>
<node concept="1M2fIO" id="2KEzU_jxFgo">
<property role="3GE5qa" value="numeric" />
<ref role="1M2myG" to="hm2y:5Ys_ngSnA9h" resolve="HexValue" />
<node concept="EnEH3" id="2KEzU_jxFk7" role="1MhHOB">
<ref role="EomxK" to="hm2y:5Ys_ngSnA9j" resolve="value" />
<node concept="QB0g5" id="2KEzU_jxFtm" role="QCWH9">
<node concept="3clFbS" id="2KEzU_jxFtn" role="2VODD2">
<node concept="3clFbF" id="2KEzU_jxGom" role="3cqZAp">
<node concept="2OqwBi" id="2KEzU_jxGUA" role="3clFbG">
<node concept="35c_gC" id="2KEzU_jxGol" role="2Oq$k0">
<ref role="35c_gD" to="hm2y:5Ys_ngSnA9h" resolve="HexValue" />
</node>
<node concept="2qgKlT" id="2KEzU_jxHjT" role="2OqNvi">
<ref role="37wK5l" to="pbu6:5Ys_ngSnA9D" resolve="isHexaDecimal" />
<node concept="1Wqviy" id="2KEzU_jxHxR" role="37wK5m" />
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</model>

Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
<concept id="1078308402140" name="jetbrains.mps.lang.editor.structure.CellModel_Custom" flags="sg" stub="8104358048506730068" index="gc7cB">
<child id="1176795024817" name="cellProvider" index="3YsKMw" />
</concept>
<concept id="1196434649611" name="jetbrains.mps.lang.editor.structure.SubstituteMenu_SimpleString" flags="ng" index="2h3Zct">
<property id="1196434851095" name="text" index="2h4Kg1" />
</concept>
<concept id="1106270549637" name="jetbrains.mps.lang.editor.structure.CellLayout_Horizontal" flags="nn" index="2iRfu4" />
<concept id="1106270571710" name="jetbrains.mps.lang.editor.structure.CellLayout_Vertical" flags="nn" index="2iRkQZ" />
<concept id="8954657570917870539" name="jetbrains.mps.lang.editor.structure.TransformationLocation_ContextAssistant" flags="ng" index="2j_NTm" />
Expand Down Expand Up @@ -275,6 +278,7 @@
<concept id="9122903797276194520" name="jetbrains.mps.lang.editor.structure.StyleClassReferenceList" flags="ng" index="1ybEpN">
<child id="9122903797276195161" name="element" index="1ybEBM" />
</concept>
<concept id="5425882385312046132" name="jetbrains.mps.lang.editor.structure.QueryFunctionParameter_SubstituteMenu_CurrentTargetNode" flags="nn" index="1yR$tW" />
<concept id="1139848536355" name="jetbrains.mps.lang.editor.structure.CellModel_WithRole" flags="ng" index="1$h60E">
<property id="1140017977771" name="readOnly" index="1Intyy" />
<property id="1140114345053" name="allowEmptyText" index="1O74Pk" />
Expand Down Expand Up @@ -339,6 +343,7 @@
<child id="7980428675268276159" name="parts" index="1Qtc8A" />
</concept>
<concept id="1176717841777" name="jetbrains.mps.lang.editor.structure.QueryFunction_ModelAccess_Getter" flags="in" index="3TQlhw" />
<concept id="2722384699544370949" name="jetbrains.mps.lang.editor.structure.SubstituteMenuPart_Placeholder" flags="ng" index="3VyMlK" />
<concept id="1176749715029" name="jetbrains.mps.lang.editor.structure.QueryFunction_CellProvider" flags="in" index="3VJUX4" />
<concept id="4307758654696938365" name="jetbrains.mps.lang.editor.structure.QueryFunction_SubstituteMenu_RefPresentation" flags="ig" index="1WAQ3h" />
<concept id="4307758654696952957" name="jetbrains.mps.lang.editor.structure.QueryFunctionParameter_SubstituteMenu_ReferencedNode" flags="ng" index="1WAUZh" />
Expand Down Expand Up @@ -7786,58 +7791,54 @@
</node>
</node>
</node>
<node concept="22mcaB" id="1DSLxNDPuN2">
<property role="3GE5qa" value="tuples" />
<ref role="aqKnT" to="hm2y:S$tO8ocniU" resolve="TupleType" />
<node concept="22hDWj" id="1DSLxNDPuQr" role="22hAXT" />
<node concept="3eGOop" id="1DSLxNDPuTO" role="3ft7WO">
<ref role="3EoQqy" to="hm2y:S$tO8ocniU" resolve="TupleType" />
<node concept="16NfWO" id="1DSLxNDPZYd" role="upBLP">
<node concept="uGdhv" id="1DSLxNDQ01v" role="16NeZM">
<node concept="3clFbS" id="1DSLxNDQ01x" role="2VODD2">
<node concept="3clFbF" id="1DSLxNDV1px" role="3cqZAp">
<node concept="2OqwBi" id="1DSLxNDV22D" role="3clFbG">
<node concept="35c_gC" id="1DSLxNDV1pv" role="2Oq$k0">
<ref role="35c_gD" to="hm2y:S$tO8ocniU" resolve="TupleType" />
</node>
<node concept="2qgKlT" id="1DSLxNDWxrK" role="2OqNvi">
<ref role="37wK5l" to="pbu6:1DSLxNDLNPn" resolve="getOpeningTag" />
</node>
</node>
</node>
<node concept="24kQdi" id="2KEzU_jECqA">
<property role="3GE5qa" value="numeric" />
<ref role="1XX52x" to="hm2y:5Ys_ngSnA9h" resolve="HexValue" />
<node concept="2SsqMj" id="2KEzU_jGitL" role="2wV5jI" />
</node>
<node concept="22mcaB" id="5JKfLQ96phH">
<property role="3GE5qa" value="numeric.number" />
<ref role="aqKnT" to="hm2y:2KEzU_jNj4j" resolve="ISupportHexValues" />
<node concept="22hDWg" id="5JKfLQ96phI" role="22hAXT">
<property role="TrG5h" value="IncompleteHexValue" />
</node>
<node concept="3eGOop" id="5JKfLQ96phJ" role="3ft7WO">
<ref role="3EoQqy" to="hm2y:2KEzU_jNj4j" resolve="ISupportHexValues" />
<node concept="ucgPf" id="5JKfLQ96phK" role="3aKz83">
<node concept="3clFbS" id="5JKfLQ96phL" role="2VODD2">
<node concept="3clFbF" id="5JKfLQ9jxMo" role="3cqZAp">
<node concept="1yR$tW" id="5JKfLQ9jxMn" role="3clFbG" />
</node>
</node>
</node>
<node concept="ucgPf" id="1DSLxNDPuTP" role="3aKz83">
<node concept="3clFbS" id="1DSLxNDPuTQ" role="2VODD2">
<node concept="3clFbF" id="1DSLxNDPv7t" role="3cqZAp">
<node concept="2ShNRf" id="1DSLxNDPv7r" role="3clFbG">
<node concept="3zrR0B" id="1DSLxNDPXiL" role="2ShVmc">
<node concept="3Tqbb2" id="1DSLxNDPXiN" role="3zrR0E">
<ref role="ehGHo" to="hm2y:S$tO8ocniU" resolve="TupleType" />
<node concept="16NfWO" id="5JKfLQ96pMh" role="upBLP">
<node concept="uGdhv" id="5JKfLQ9g5jk" role="16NeZM">
<node concept="3clFbS" id="5JKfLQ9g5jm" role="2VODD2">
<node concept="3clFbF" id="5JKfLQ9g5rG" role="3cqZAp">
<node concept="2OqwBi" id="5JKfLQ9g60n" role="3clFbG">
<node concept="35c_gC" id="5JKfLQ9g5rF" role="2Oq$k0">
<ref role="35c_gD" to="hm2y:2KEzU_jNj4j" resolve="ISupportHexValues" />
</node>
<node concept="2qgKlT" id="5JKfLQ9g6qa" role="2OqNvi">
<ref role="37wK5l" to="pbu6:5JKfLQ9g2ZR" resolve="getHexPrefix" />
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="16NL0t" id="1DSLxNDPXqI" role="upBLP">
<node concept="uGdhv" id="1DSLxNDPXuK" role="16NL0q">
<node concept="3clFbS" id="1DSLxNDPXuM" role="2VODD2">
<node concept="3clFbF" id="1DSLxNDSdJ6" role="3cqZAp">
<node concept="2OqwBi" id="1DSLxNDSdJ7" role="3clFbG">
<node concept="35c_gC" id="1DSLxNDSdJ8" role="2Oq$k0">
<ref role="35c_gD" to="hm2y:S$tO8ocniU" resolve="TupleType" />
</node>
<node concept="liA8E" id="1DSLxNDSdJ9" role="2OqNvi">
<ref role="37wK5l" to="c17a:~SAbstractConcept.getShortDescription()" resolve="getShortDescription" />
</node>
</node>
</node>
</node>
<node concept="16NL0t" id="5JKfLQ96pVZ" role="upBLP">
<node concept="2h3Zct" id="5JKfLQ96q9C" role="16NL0q">
<property role="2h4Kg1" value="hexadecimal literal" />
</node>
</node>
</node>
<node concept="3VyMlK" id="5JKfLQ96pVk" role="3ft7WO" />
</node>
<node concept="22mcaB" id="68wLGjptyli">
<property role="3GE5qa" value="numeric" />
<ref role="aqKnT" to="hm2y:5Ys_ngSnA9h" resolve="HexValue" />
<node concept="22hDWj" id="68wLGjptylj" role="22hAXT" />
</node>
<node concept="22mcaB" id="1DSLxNDQ1bz">
<property role="3GE5qa" value="tuples" />
Expand Down Expand Up @@ -7892,5 +7893,58 @@
</node>
</node>
</node>
<node concept="22mcaB" id="1DSLxNDPuN2">
<property role="3GE5qa" value="tuples" />
<ref role="aqKnT" to="hm2y:S$tO8ocniU" resolve="TupleType" />
<node concept="22hDWj" id="1DSLxNDPuQr" role="22hAXT" />
<node concept="3eGOop" id="1DSLxNDPuTO" role="3ft7WO">
<ref role="3EoQqy" to="hm2y:S$tO8ocniU" resolve="TupleType" />
<node concept="16NfWO" id="1DSLxNDPZYd" role="upBLP">
<node concept="uGdhv" id="1DSLxNDQ01v" role="16NeZM">
<node concept="3clFbS" id="1DSLxNDQ01x" role="2VODD2">
<node concept="3clFbF" id="1DSLxNDV1px" role="3cqZAp">
<node concept="2OqwBi" id="1DSLxNDV22D" role="3clFbG">
<node concept="35c_gC" id="1DSLxNDV1pv" role="2Oq$k0">
<ref role="35c_gD" to="hm2y:S$tO8ocniU" resolve="TupleType" />
</node>
<node concept="2qgKlT" id="1DSLxNDWxrK" role="2OqNvi">
<ref role="37wK5l" to="pbu6:1DSLxNDLNPn" resolve="getOpeningTag" />
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="ucgPf" id="1DSLxNDPuTP" role="3aKz83">
<node concept="3clFbS" id="1DSLxNDPuTQ" role="2VODD2">
<node concept="3clFbF" id="1DSLxNDPv7t" role="3cqZAp">
<node concept="2ShNRf" id="1DSLxNDPv7r" role="3clFbG">
<node concept="3zrR0B" id="1DSLxNDPXiL" role="2ShVmc">
<node concept="3Tqbb2" id="1DSLxNDPXiN" role="3zrR0E">
<ref role="ehGHo" to="hm2y:S$tO8ocniU" resolve="TupleType" />
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="16NL0t" id="1DSLxNDPXqI" role="upBLP">
<node concept="uGdhv" id="1DSLxNDPXuK" role="16NL0q">
<node concept="3clFbS" id="1DSLxNDPXuM" role="2VODD2">
<node concept="3clFbF" id="1DSLxNDSdJ6" role="3cqZAp">
<node concept="2OqwBi" id="1DSLxNDSdJ7" role="3clFbG">
<node concept="35c_gC" id="1DSLxNDSdJ8" role="2Oq$k0">
<ref role="35c_gD" to="hm2y:S$tO8ocniU" resolve="TupleType" />
</node>
<node concept="liA8E" id="1DSLxNDSdJ9" role="2OqNvi">
<ref role="37wK5l" to="c17a:~SAbstractConcept.getShortDescription()" resolve="getShortDescription" />
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</model>

Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,31 @@
<node concept="17QB3L" id="3p6$WoErLfy" role="1tU5fm" />
</node>
</node>
<node concept="3clFb_" id="5JKfLQ870IQ" role="jymVt">
<property role="TrG5h" value="createIntegerType" />
<node concept="3Tqbb2" id="5JKfLQ870IR" role="3clF45">
<ref role="ehGHo" to="hm2y:6sdnDbSlaok" resolve="Type" />
</node>
<node concept="3Tm1VV" id="5JKfLQ870IS" role="1B3o_S" />
<node concept="3clFbS" id="5JKfLQ870IT" role="3clF47">
<node concept="3clFbF" id="5JKfLQ8731k" role="3cqZAp">
<node concept="1rXfSq" id="5JKfLQ8731j" role="3clFbG">
<ref role="37wK5l" node="2Qbt$1tSx20" resolve="createIntegerType" />
<node concept="37vLTw" id="5JKfLQ873sD" role="37wK5m">
<ref role="3cqZAo" node="5JKfLQ870IU" resolve="value" />
</node>
</node>
</node>
</node>
<node concept="37vLTG" id="5JKfLQ870IU" role="3clF46">
<property role="TrG5h" value="value" />
<node concept="17QB3L" id="5JKfLQ870IV" role="1tU5fm" />
</node>
<node concept="37vLTG" id="5JKfLQ86V3X" role="3clF46">
<property role="TrG5h" value="isHexadecimal" />
<node concept="10P_77" id="5JKfLQ86V46" role="1tU5fm" />
</node>
</node>
<node concept="3clFb_" id="4kor_v$1eBp" role="jymVt">
<property role="TrG5h" value="createGenericIntegerType" />
<property role="1EzhhJ" value="true" />
Expand All @@ -1019,6 +1044,31 @@
<node concept="17QB3L" id="5HLmk5GD8hc" role="1tU5fm" />
</node>
</node>
<node concept="3clFb_" id="5JKfLQ8ecRT" role="jymVt">
<property role="TrG5h" value="createIntegerType" />
<property role="1EzhhJ" value="true" />
<node concept="3Tqbb2" id="5JKfLQ8ecRU" role="3clF45">
<ref role="ehGHo" to="hm2y:6sdnDbSlaok" resolve="Type" />
</node>
<node concept="3Tm1VV" id="5JKfLQ8ecRV" role="1B3o_S" />
<node concept="3clFbS" id="5JKfLQ8ecRW" role="3clF47" />
<node concept="37vLTG" id="5JKfLQ8ecRX" role="3clF46">
<property role="TrG5h" value="min" />
<node concept="17QB3L" id="5JKfLQ8ecRY" role="1tU5fm" />
</node>
<node concept="37vLTG" id="5JKfLQ8ed3s" role="3clF46">
<property role="TrG5h" value="minIsHexadecimal" />
<node concept="10P_77" id="5JKfLQ8ed3t" role="1tU5fm" />
</node>
<node concept="37vLTG" id="5JKfLQ8ecRZ" role="3clF46">
<property role="TrG5h" value="max" />
<node concept="17QB3L" id="5JKfLQ8ecS0" role="1tU5fm" />
</node>
<node concept="37vLTG" id="5JKfLQ8edgC" role="3clF46">
<property role="TrG5h" value="maxIsHexadecimal" />
<node concept="10P_77" id="5JKfLQ8edgD" role="1tU5fm" />
</node>
</node>
<node concept="3clFb_" id="2Qbt$1tSx2j" role="jymVt">
<property role="TrG5h" value="createRealType" />
<property role="1EzhhJ" value="true" />
Expand Down Expand Up @@ -1230,7 +1280,19 @@
</node>
</node>
</node>
<node concept="2tJIrI" id="2q0DACtJfgT" role="jymVt" />
<node concept="2tJIrI" id="5Ys_ngSn6GE" role="jymVt" />
<node concept="3Tm1VV" id="2Qbt$1tSnqi" role="1B3o_S" />
<node concept="3clFb_" id="5Ys_ngSn72Q" role="jymVt">
<property role="TrG5h" value="allowHexadecimalNumbers" />
<node concept="3clFbS" id="5Ys_ngSn72R" role="3clF47">
<node concept="3clFbF" id="5Ys_ngSn9YX" role="3cqZAp">
<node concept="3clFbT" id="5Ys_ngSn9YW" role="3clFbG" />
</node>
</node>
<node concept="3Tm1VV" id="5Ys_ngSn72W" role="1B3o_S" />
<node concept="10P_77" id="5Ys_ngSn72X" role="3clF45" />
</node>
<node concept="2tJIrI" id="5Ys_ngSn6GF" role="jymVt" />
<node concept="3clFb_" id="1DSLxNDLebJ" role="jymVt">
<property role="TrG5h" value="useParenthesisInsteadOfBracketsForTuples" />
<node concept="3clFbS" id="1DSLxNDLebM" role="3clF47">
Expand All @@ -1241,7 +1303,6 @@
<node concept="3Tm1VV" id="1DSLxNDLbg7" role="1B3o_S" />
<node concept="10P_77" id="1DSLxNDLe7n" role="3clF45" />
</node>
<node concept="3Tm1VV" id="2Qbt$1tSnqi" role="1B3o_S" />
</node>
<node concept="vrV6u" id="WieAE6FJqt">
<property role="TrG5h" value="primitiveTypeMapper" />
Expand Down
Loading

0 comments on commit 57b05c8

Please sign in to comment.