klorenz / atom-regex-railroad-diagrams

display regex as railroad diagram, if cursor moves to it
MIT License
250 stars 31 forks source link

Perl =~ /REGEX/ parsing error (match operator) #15

Closed mabstorm closed 9 years ago

mabstorm commented 10 years ago

Given this test in perl: $line =~ /[a-z]*/

Or any test of the form: $variablename =~ /REGEX/

This error pops up: ~ /[a-z]*/ ^ Expected "$", "("...........CharacterSet, Literal, or Quantifier but "/" found (for the first "/")

"MATCH operators will test a string of information to see if the specified regular expression is present. If true, the statement returns a true (non-zero) value. If no match, it returns a zero or false value. The match is symbolized by an equals and tilde. "

Do you think there's anything you can do about this? (PS. This tool is awesome when it works!)

klorenz commented 10 years ago

Hi mabstorm,

this tool relies on syntax highlighting scope names. Looks like perl regexes start with matching operator. Will fix it these days ...

Best regards, Kiwi

art-solopov commented 10 years ago

Not sure if related or not, but it also displays the diagram incorrectly if the delimeter is not /. For instance, try parsing m{\d+/\d+}.

klorenz commented 9 years ago

This issue is not present anymore.