Code: Select all
c = WO`FirstUpper[WO`SanitizeString[s]];
Code: Select all
WO`SanitizeString[s_] := WO`StringReplaceAll[s, WO`StringRules];
WO`StringReplaceAll[s_, l_List] := FixedPoint[StringReplace[#, l]&, s]
In my particular case, it tries to sanitise "{{2}}" which causes the following sequence:
Code: Select all
{{2}}
__2__
_2_
2__
__2
_2
2_
_2
2_
_2
2_
...
Looking at the way OmegaConstructor is used though, I suspect the bug is really somewhere else as I doubt "{{2}"" is an expected input. The bug occurs when OmegaConstructor parses plist on line ~1120. Tracing back where the "{{2}}" comes from, it comes from getOutputName[y_,gen_,fla___] on line 1779 of mathParticleProp.m.
Ultimately, it was because I had a particle called "SP" which results in the name "SP2" and when getOutputName generates the name, it actually evaluates the name:
Code: Select all
ToExpression[SP <> ToString[2]]
As a temporary solution, I have renamed the "SP" particle to something else that doesn't conflict, but perhaps this could be changed in the future so that any particle name could be used.