-
Notifications
You must be signed in to change notification settings - Fork 473
Disallow control characters in literals #143
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
Conversation
@@ -88,7 +88,7 @@ let letter = ['a'-'z''A'-'Z'] | |||
let symbol = ['+''-''*''/''\\''^''~''=''<''>''!''?''@''#''$''%''&''|'':''`''.'] | |||
let tick = '\'' | |||
let escape = ['n''t''\\''\'''\"'] | |||
let character = [^'"''\\''\n'] | '\\'escape | '\\'hexdigit hexdigit | |||
let character = [^'"''\\''\x00'-'\x1f'] | '\\'escape | '\\'hexdigit hexdigit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (an below) should also exclude \x7f, the DEL character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
sgtm. Is it possible to write a test confirming that control characters are rejected? |
For the record, I think we'll want something slightly different as I mention in #142 (comment) This change shouldn't be blocked on it, though. |
Difficult. We don't have any infrastructure for testing syntax errors, which could only work outside the script language. Not sure it's worth the effort either. |
Addressed comment, PTAL. |
lgtm |
Disallow control characters in literals
Fixes WebAssembly#142. A mismatched `DataCount` is malformed, not a validation error.
It's not the same as the proposed specification document.
…mbly#143) * formal spec overview for the 3rd exception handling proposal This adds a condensed version of the current core formal spec, and some examples of reductions according to this spec. These files were added to aid in discussions when finalising spec details. After 260 PR comments and suggestions co-authors are: Co-authored-by: Andreas Rossberg <[email protected]> Co-authored-by: Heejin Ahn <[email protected]> Co-authored-by: Ross Tate <[email protected]>
This is not the suggestion given in that last review of WebAssembly#143: https://github.com/WebAssembly/exception-handling/pull/143/files#r759907998 but a potential fix of the issue raised there.
Addresses #142.