Parser: fix Octal escape such as \75 to be treated as an Octal number, not Decimal
See original GitHub issue/\75/
Should parse into:
{
"type": "Char",
"value": "\\75",
"kind": "oct",
"symbol": "=",
}
And not to:
{
"type": "Char",
"value": "\\75",
"kind": "decimal",
"symbol": "K",
}
See LegacyOctalEscapeSequence
in Annex B: http://www.ecma-international.org/ecma-262/7.0/#sec-additional-syntax-string-literals
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
SyntaxError: "0"-prefixed octal literals and octal escape seq ...
Octal literals and octal escape sequences are deprecated and will throw a SyntaxError in strict mode. The standardized syntax uses a leading ...
Read more >Treat octal numbers as decimals - java - Stack Overflow
I'm not quite sure what you want to achieve. Do you want to be able to read an Integer , given as String...
Read more >Python Tutorial - Getting Started with Python and Python Basics
List is similar to C/C++/C#/Java's array but NOT fixed-size. ... oct(decNumber) , bin(decNunber) to convert decimal to hexadecimal, octal and binary, ...
Read more >lib/Lex/LiteralSupport.cpp Source File - Clang
212 // Octal escapes are a series of octal digits with maximum length 3. 213 // "\0123" is a two digit sequence equal...
Read more >std::Constants - CPlusPlus.com
In addition to decimal numbers (those that all of us are used to using every day), C++ allows the use of octal numbers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, with
u
flag it’s an invalid encoding. I’m not sure whetherregexp-tree
needs to actively and fully support Annex B (after all it’s a depurated legacy stuff). Probably only for interpreter module, which still should interpret/\75/.test('=');
astrue
. Not sure if it’s even essential for the parser now. But for the parser, yes, it goes toLegacyOctalEscapeSequence
.@qfox, ah, autocorrect for “depurated”, but that’s right 😃 Yeah, I think we still need to fix and treat
\75
and other as Octal, and match=
in the interpreter.