Skip to content

Commit

Permalink
Improve how the parser is generated
Browse files Browse the repository at this point in the history
- use long variant of options for re2c in its makefile
- use `define` instead of magic numbers
- add some consts
- trailing `;` are now mandatory for conditions
- NULL bytes are no longer allowed in configuration file
- the parser shouldn't crash in the absence of trailing new line at the end of its configuration file
  • Loading branch information
jvoisin committed Apr 29, 2023
1 parent 8532f01 commit cee5535
Show file tree
Hide file tree
Showing 7 changed files with 646 additions and 595 deletions.
4 changes: 2 additions & 2 deletions src/Makefile.frag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$(srcdir)/sp_config_scanner.c: $(srcdir)/sp_config_scanner.re
if re2c -v |grep ' [23]\.' 2>/dev/null; then \
re2c -bc -o $@ $<; \
re2c --no-generation-date --no-version -bci -o $(srcdir)/sp_config_scanner.cached.c $<; \
re2c -W --conditions --bit-vectors --no-debug-info --output $@ $<; \
re2c -W --no-generation-date --bit-vectors --no-version --conditions --no-debug-info --output $(srcdir)/sp_config_scanner.cached.c $<; \
else \
cp $(srcdir)/sp_config_scanner.cached.c $@; \
fi;
Expand Down
Loading

0 comments on commit cee5535

Please sign in to comment.