Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parser: fix Octal escape such as \75 to be treated as an Octal number, not Decimal

See original GitHub issue

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:

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

DmitrySoshnikovcommented, May 12, 2017

Yeah, with u flag it’s an invalid encoding. I’m not sure whether regexp-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('='); as true. Not sure if it’s even essential for the parser now. But for the parser, yes, it goes to LegacyOctalEscapeSequence.

DmitrySoshnikovcommented, May 14, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 -
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found