question-mark
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.

ESCAPED_STRING doesn't parse \n

See original GitHub issue

Describe the bug

ESCAPED_STRING doesn’t parse “\n”. I expected to get Tree('start', [Token('ESCAPED_STRING', '"\n"')])

To Reproduce With lark.__version__ == '0.11.1'

Lark(
r"""
start: ESCAPED_STRING
%import common.ESCAPED_STRING
"""
).parse('"\n"')

Will result in error:

UnexpectedCharacters: No terminal defined for '"' at line 1 col 1

"
^

Expecting: {'ESCAPED_STRING'}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matiasmorantcommented, Jan 28, 2021

Ah good catch! Lark is impressive, you are a genius @erezsh . I started using it yesterday

0reactions
erezshcommented, Jan 28, 2021

Thanks! I hope you’ll keep having a good experience with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to escape a JSON string containing newline characters ...
I tried escaping the new line character \n to \\n. It is working fine. But i am looking for any JS library which...
Read more >
TMPro will not parse "\n" when string is changed via UI event ...
1. I have txt and btn. 2. btn will use the UI's OnClick event to change txt.text's string: "Hello\nWorld" 3. Ensure "parse escape...
Read more >
Multiple problems parsing JSON, escaping, encoding ... - GitHub
This would allow all fields to be decoded after being parsed, but will break in cases (such as when parsing nested JSON) where...
Read more >
Escaping new line character in JSON to avoid data loading ...
Presence of a new-line character (\n) in JSON document can cause errors while loading data in Snowflake. This article details how to escape...
Read more >
JavaScript Strings - W3Schools
JavaScript strings are for storing and manipulating text. ... The backslash ( \ ) escape character turns special characters into string characters: ...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found