Skip to content

Commit f9fd4b2

Browse files
committed
A very important fix actually
1 parent fee0b7f commit f9fd4b2

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

RSML.Docs/Documentation/Migrate_From_MFRoad/Migrating.org

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,4 @@ win.+ -> "foobar"
3131

3232
Yup, that represents the very same thing. And before you say "win32 isn't the same as win", remember that in MFRoad, ~win32~ is the designation for any Windows version.
3333

34-
However - and this is going to be specifically amusing to those who fear Regex - you don't need it in your RSML. At least, most of the time. The reason for it is that RSML uses MSBuild Runtime Identifiers and these follow a hierarchy.
35-
36-
Just writing the following RSML will evluate to ~"Hello, World!"~ in every single x64 machine.
37-
#+begin_src python
38-
x64 -> "Hello, World!"
39-
# you don't need .+x64
40-
#+end_src
41-
42-
Same with MacOS (which uses RID ~osx~) and Linux. If you want to adress both, you don't need to do Regex black magic. You can just use RID ~unix~.
43-
#+begin_src python
44-
# Don't do this:
45-
# {linux|osx}.+ -> "Hey"
46-
47-
# Do this:
48-
unix -> "Hey"
49-
#+end_src
50-
51-
However, if you're doing more complex checking, you are completely free to use Regex.
52-
5334
#+todo: cook dis

RSML/Parser/RSParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ protected byte HandleSpecialFunctionCall(string line)
187187
string systemName = splitLine[0].Trim();
188188

189189
// quick evaluation
190-
if (!Regex.IsMatch(RuntimeInformation.RuntimeIdentifier, systemName)) return null;
190+
if (!Regex.IsMatch(RuntimeInformation.RuntimeIdentifier, $"^{systemName}$")) return null;
191191

192192
string returnValue = splitLine[1].Trim();
193193

0 commit comments

Comments
 (0)