yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
880 stars 112 forks source link

Grammar accepted on playground is rejected by "peglint" #215

Closed mingodad closed 2 years ago

mingodad commented 2 years ago

With the grammars attached I can use then with packrat on the playground but on command line peglint only the kotlin.peglib works the kotlin-perf.pegli gives this error:

../../cpp-peglib0/build/lint/peglint --packrat --ast kotlin-perf.chpeg kotlin.kt
kotlin-perf.chpeg:9:5: syntax error
Command exited with non-zero status 255

kotlin-peglib.zip

yhirose commented 2 years ago

@mingodad, I can't reproduce the problem...

> peglint --packrat --ast kotlin-perf.peglib kotlin.kt > /dev/null
>
mingodad commented 2 years ago

Thank you ! After I received the message of closing this issue I went back and tried to reproduce the problem and at first I was getting the error, then I did a copy and paste from your reply and it worked. After several experiments I found my mistake, I was using the wrong grammar as shown on my first message kotlin-perf.chpeg I didn't noticed that I was using the wrong extension .chpeg instead of .peglib. Again sorry by the noise and thank you again for your help and great work.