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.

Can't have close square brackets escaped inside ranges

See original GitHub issue

Testing a bash grammar I found that rr doesn’t accept close square bracket escaped inside ranges (open square brackets it’s OK):

nonsquarebra ::=  [^\[\]]

Output:

lexical analysis failed
while expecting [Whitespace, NCName, StringLiteral, CharCode, '/*ws:explicit*/', '/*ws:definition*/', DocComment, EOF, EquivalenceLookAhead, '$', '&', '(', ')', '*', '+', '-', '.', '/', '<?', '<?ENCORE?>', '<?TOKENS?>', '?', '[', '[^', '|']
at line 1, column 25:
...]...

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
myCrackcommented, Mar 24, 2021

Would be nice if rr had an option to relax/accept common escaped sequences \t\r\n\s\S\w\W... or even regular expressions like /.../.

RR use ebnf defined by w3c, so i think it is a bad idea.

0reactions
mingodadcommented, Mar 25, 2021

Also I did converted (naively) several (64) grammars from tree-sitter to the EBNF supported by this project here https://github.com/mingodad/plgh, would be nice to have a link to then in https://www.bottlecaps.de/rr/ui

tree-sitter-abnf.ebnf
tree-sitter-agda.ebnf
tree-sitter-bash.ebnf
tree-sitter-beancount.ebnf
tree-sitter-carp.ebnf
tree-sitter-c.ebnf
tree-sitter-clojure.ebnf
tree-sitter-cpp.ebnf
tree-sitter-c-sharp.ebnf
tree-sitter-css.ebnf
tree-sitter-dart.ebnf
tree-sitter-elm.ebnf
tree-sitter-embedded-template.ebnf
tree-sitter-eno.ebnf
tree-sitter-erlang.ebnf
tree-sitter-fennel.ebnf
tree-sitter-fortran.ebnf
tree-sitter-go.ebnf
tree-sitter-graphql.ebnf
tree-sitter-haskel.ebnf
tree-sitter-html.ebnf
tree-sitter-janet.ebnf
tree-sitter-java.ebnf
tree-sitter-javascript.ebnf
tree-sitter-jsdoc.ebnf
tree-sitter-julia.ebnf
tree-sitter-kotlin.ebnf
tree-sitter-lbnf.ebnf
tree-sitter-lean.ebnf
tree-sitter-ledger.ebnf
tree-sitter-lua.ebnf
tree-sitter-markdown.ebnf
tree-sitter-menhir.ebnf
tree-sitter-minizinc.ebnf
tree-sitter-nim.ebnf
tree-sitter-nix.ebnf
tree-sitter-perl.ebnf
tree-sitter-php.ebnf
tree-sitter-powershell.ebnf
tree-sitter-prolog.ebnf
tree-sitter-python.ebnf
tree-sitter-ql.ebnf
tree-sitter-reason.ebnf
tree-sitter-r.ebnf
tree-sitter-regex.ebnf
tree-sitter-ruby.ebnf
tree-sitter-rust.ebnf
tree-sitter-scala.ebnf
tree-sitter-sexp.ebnf
tree-sitter-sml.ebnf
tree-sitter-sourcepawn.ebnf
tree-sitter-sparql.ebnf
tree-sitter-stan.ebnf
tree-sitter-svelte.ebnf
tree-sitter-swift.ebnf
tree-sitter-systemrdl.ebnf
tree-sitter-teal.ebnf
tree-sitter-toml.ebnf
tree-sitter-turtle.ebnf
tree-sitter-verilog.ebnf
tree-sitter-vhdl.ebnf
tree-sitter-vue.ebnf
tree-sitter-wasm-wast.ebnf
tree-sitter-yaml.ebnf
tree-sitter-zig.ebnf
Read more comments on GitHub >

github_iconTop Results From Across the Web

Does a dot have to be escaped in a character class (square ...
In order for regex to match a dot, the dot has to be escaped: \. It has been pointed out to me that...
Read more >
Escaping square brackets in LIKE clause in SQL Server
According to Microsoft Docs, square brackets can be used in LIKE clause to match any single character within the specified range ([b-h]) or...
Read more >
sed: escaped square closing bracket does not match
part that I can't get to work. As a simple example, I want to match the input a [test] b . This is...
Read more >
How to Escape Square Brackets in a LIKE Clause in SQL ...
It is used to match any single character within the specified range like ([b-h]) or set ([ghijk]). We can escape square brackets using...
Read more >
regular expression pattern difference between [\.\-]
No; there is no escape character inside square brackets. Inside square brackets, '.' and'\' have no special meaning, so there is no need...
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