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
%q{"\\" | "a"} is "\" | "a" in RBS. So, the syntax error is expected one.
The problem is when we give "\\" | "a" in RBS. This should be parse. But, it didn't because of the dqstring pattern in lexer.re
dqstring = ["] ("\\"["] | [^"\x00])* ["]; // Before
dqstring = ["] ("\\"[abefnrstv"\\] | [^"\\\x00])* ["]; // After
With the Before pattern, the first \ in "\\" was eaten by the second alternation. And the next \" in "\\" was eaton by the first alternation. It cannot detect the end of string, and parsing fails.
The After pattern is more explicit on what can come just after \. The two \\ are eaten by the first alternation, and the closing " is processed correctly.
"\\"
and1
can create a Union type."a"
and"\\"
also can create a Union type,whereas
"\\"
and"a"
would result in a Syntax error.Shouldn't it be possible to create a Union type in
"\\" | "a"
cases?The text was updated successfully, but these errors were encountered: