klorenz / atom-regex-railroad-diagrams

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

Uncaught SyntaxError: Invalid flags supplied to RegExp constructor '\/' #92

Open chenjau opened 7 years ago

chenjau commented 7 years ago

[Enter steps to reproduce:]

  1. create a ruby file(.rb)
  2. paste x = %r{/assets/}
  3. click on that.

ps(guessing): '/' above is literal, but interpreted as indicates of the start and end.

Atom: 1.20.0-dev-5a8dce117 x64 Electron: 1.6.9 OS: Mac OS X 10.12.5 Thrown From: regex-railroad-diagram package 0.19.3

Stack Trace

Uncaught SyntaxError: Invalid flags supplied to RegExp constructor '\/'

At /Users/[name]/.atom/packages/regex-railroad-diagram/lib/regex-railroad-diagram.coffee:166

SyntaxError: Invalid flags supplied to RegExp constructor '\/'
    at new RegExp (<anonymous>)
    at Object.cleanRegex (/packages/regex-railroad-diagram/lib/regex-railroad-diagram.coffee:166:32)
    at Object.checkForRegExp (/packages/regex-railroad-diagram/lib/regex-railroad-diagram.coffee:206:27)
    at /packages/regex-railroad-diagram/lib/regex-railroad-diagram.coffee:29:73
    at later (/packages/zentabs/node_modules/underscore/underscore.js:724:25)

Non-Core Packages

activate-power-mode 2.1.0 
aligner 1.2.3 
aligner-javascript 1.1.0 
aligner-ruby 1.6.1 
aligner-scss 1.3.1 
atom-beautify 0.30.3 
atom-clock 0.1.12 
autocomplete-paths 1.0.5 
busy-signal 1.4.3 
dash 1.7.1 
file-icons 2.1.8 
git-control 0.9.0 
git-time-machine 1.5.9 
highlight-selected 0.13.1 
intentions 1.1.2 
language-slim 0.5.0 
linter 2.2.0 
linter-coffeelint 1.2.1 
linter-eslint 8.2.1 
linter-rubocop 2.1.1 
linter-sass-lint 1.7.4 
linter-slim-lint 2.0.0 
linter-ui-default 1.6.2 
minimap 4.28.2 
minimap-hide 0.3.0 
platformio-ide-terminal 2.5.1 
rails-transporter 1.7.0 
regex-railroad-diagram 0.19.3 
simplified-chinese-menu 5.3.4 
Sublime-Style-Column-Selection 1.7.4 
todo-show 1.11.0 
toggle-quotes 1.0.1 
zentabs 0.8.8 
nestor-custodio commented 7 years ago

I'm seeing this error even without '/' in the regex. Literally %r{} (which is equivalent to //) starts throwing this error on every keypress within the delimiters.

TG-KK commented 6 years ago

Atom 1.20.0, regex-railroad-diagram 0.19.3, and this is still happening.

Sod-Almighty commented 6 years ago

Atom 1.19.7, regex-railroad-diagram 0.19.3, happening for me also. Is there likely to be a fix?