pest-parser / pest

The Elegant Parser
https://pest.rs
Apache License 2.0
4.67k stars 261 forks source link

hebrew not working properly #928

Closed raisfeld-ori closed 1 year ago

raisfeld-ori commented 1 year ago

Describe the bug i am using pest to write a parser for the hebrew language. according to the documentation, HEBREW should work for this, but it simply doesn't. the simplest example i found is this:

hebrew_line = {SOI ~ HEBREW ~ EOI}

i tried to write "טקסט" as input (which is in hebrew) and i got an ERROR.

To Reproduce create a basic pest project (you know, cargo add pest, writing the parser and stuff) and then in a .pest file in the src folder write

hebrew_line = {SOI ~ HEBREW ~ EOI}

and then just parse any line that should be working and see what happens

Expected behavior the hebrew_line is expected to read hebrew and fail if it doesn't, but even in a case where there is only hebrew, the parser still returns and error.

Additional context just to mention, using a string (as in "טקסט") still works well, it's just that the HEBREW from the script properties seems to not work. so either there's an issue with HEBREW, or that the docs are outdated

tomtau commented 1 year ago

@raisfeld-ori HEBREW means a single hebrew character. For multiple characters, it needs an operator after it:

hebrew_line = {SOI ~ HEBREW+ ~ EOI}

Does it work?