-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Illegal token syntax error in windows-edited JavaScript from carriage return character #365
Comments
I can't reproduce it. Which version of Ace are you using? Does it happen in http://ajaxorg.github.com/ace/build/editor.html? |
I can reproduce in http://ajaxorg.github.com/ace/ if I drag and drop a file to it from the Mac Finder. Note that drag and drop does not work in http://ajaxorg.github.com/ace/build/editor.html. Did the file you tried really has a hex 0d in it. I've used emacs -> Meta-x hexl-mode to verify. Is there a way to do attachments in github issues? If so, I could attach a zip with an example file. My Ace version is about a week old, but it doesn't look like the recent sources have changed anything in jslex. |
Could you send my the zip via mail to [email protected]? |
I found a way to create a problematic file on the Mac:
Illegal token will show up in the margin $ cat x.js $ tr "e" "\r" < x.js > y.js $ |
Thanks Paul!. I was finally able to reproduce it. Updating narcissus fixed the issue. |
JavaScript parsing completely fails with one single "Ilegal token" error message if the file contains any carriage return characters - hex 0xd or string - '\r'
Proposed fix:
--- a/lib/ace/narcissus/jslex.js
+++ b/lib/ace/narcissus/jslex.js
@@ -166,7 +166,7 @@ Tokenizer.prototype = {
break;
}
}
On my branch at paulb777@6d350c8
The text was updated successfully, but these errors were encountered: