-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments are not properly ignored when reading flex decoder configuration blocks #2954
Comments
It is a deficit of the "parser". The whole "block" is parsed as a single string, as if it was given on the command line. I guess a to-end-of-line comment would not work there. We'd need to strip something like |
I hear that these days alll the cool kids are using Parsing Expression Grammars. |
Sounds fun. I've been enjoying Nom and there seems to be a PEG wrapper for it. I might give that a try just to get a feel of PEG. |
Interesting, seems the simple quick parse a line has been getting the job done. Somewhat separate question, does the limitation of 8 get= statements come from current parsing limitations or other practical constraints? |
It should be 16 possible getters. https://github.com/merbanan/rtl_433/blob/master/src/devices/flex.c#L77 |
Hmm, adding the 9th gives me this error:
When I follow the line you pointed to (line 77) it says, |
I confused it with |
I have bumped up against it. Though it is good motivation to implement a regular decoder instead. |
In config files, comments beginning with
#
get filtered out, BUT not if they are part of adecoder { .... }
block's key value pairs. Should this an enhancement request or is there some bit of flex decoder syntax that prevents that?So for example if you try to comment out a line in the decoder or add some doc, you get:
# my comment
on a line by itself --Bad flex spec, unknown keyword (#mycomment)!
(white space was removed in the error message)get=name:@24:{1}, # skip the next bit
--Bad flex spec, unknown keyword (#skipthenexbitget)!
(note the get added at the end)The text was updated successfully, but these errors were encountered: