You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is a Turkish-I problem in Pegasus/Compiler/CodeGenerator/Grammar.weave file with 239 line.
While using "[a-z]i" regex expression string comparison is done with CurrentCultureIgnoreCase and parser cannot match any thing if "I" character is used. Its should be InvariantCultureIgnoreCase to solve this problem. I have solve this with "[a-zA-Z]i" as workaround for now. Maybe its best to pass string comparison enumeration to parser for other scenarios.
So, there is actually an inconsistency in Pegasus' handling of the ignore case flag.
For strings, this logic is used:
if (ignoreCase ? substr.Equals(literal, StringComparison.OrdinalIgnoreCase) : substr == literal)
Whereas for character ranges, this logic is used:
match = (char.IsUpper(o) || char.IsLower(o)) && cs.Equals(o.ToString(), StringComparison.CurrentCultureIgnoreCase);
It sounds like we need to make this consistent and configurable, yes? Do you feel that it is likely that any given parser would need to specify Current Culture, Invariant Culture, and Ordinal in different spots in their parser?
It is important to note that changing these defaults will require a major version bump, as it is a breaking change.
Hi,
I think there is a Turkish-I problem in Pegasus/Compiler/CodeGenerator/Grammar.weave file with 239 line.
While using "[a-z]i" regex expression string comparison is done with CurrentCultureIgnoreCase and parser cannot match any thing if "I" character is used. Its should be InvariantCultureIgnoreCase to solve this problem. I have solve this with "[a-zA-Z]i" as workaround for now. Maybe its best to pass string comparison enumeration to parser for other scenarios.
You can find details from https://blog.codinghorror.com/whats-wrong-with-turkey/
The text was updated successfully, but these errors were encountered: