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.

syntax for multiline comments

See original GitHub issue

what would be the grammar to parse expressions like (Delphi):

(* this is a multiline comment
// containing a single line comment
{ and possibly another
multiline comment, and so on recursively}
*)

thanks ! (I’ll share the Delphi grammar as soon as it works)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
delzaccommented, Jan 23, 2019

Hi, just want to feedback back that defining grammar in a python file should be done as a raw string was a gotcha to me. Perhaps it might be helpful to add it in the examples or something.

Anyhow, lark is a joy to use, thanks for maintaining it 😃

2reactions
erezshcommented, Feb 9, 2018

@mcondarelli If you’re defining the grammar in a Python file, you should define it as a raw string:

parser = Lark( r""" grammar """, ...)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Comments - W3Schools
Multi Line Comments. Python does not really have a syntax for multi line comments. To add a multiline comment you could insert a...
Read more >
How to Comment Out Multiple Lines in Python - freeCodeCamp
To comment out multiple lines in Python, you can prepend each line with a hash ( # ). # print("Hello world") # print("Hello...
Read more >
Multiline comments in Python - GeeksforGeeks
Python multi-line comment is a piece of text enclosed in a delimiter (“””) on each end of the comment. Again there should be...
Read more >
/* Multi-line comments */ - Progress Software
Allows you to add explanatory text to code. The comment begins with /* and ends with */. This type of comment can wrap...
Read more >
How do I create multiline comments in Python? - Stack Overflow
Python does have a multiline string/comment syntax in the sense that unless used as docstrings, multiline strings generate no bytecode ...
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