diff options
| author | jvoisin | 2023-04-29 16:46:02 +0200 |
|---|---|---|
| committer | jvoisin | 2023-04-29 16:46:02 +0200 |
| commit | cee55351d6c2865447e72d9e3e8ba5922647162d (patch) | |
| tree | 8172322ef3cb9560611b00e3addf8ce89d51053a /src/Makefile.frag | |
| parent | 8532f01c7f3c356fbb2dda593477d3902491de77 (diff) | |
Improve how the parser is generated
- 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
Diffstat (limited to 'src/Makefile.frag')
| -rw-r--r-- | src/Makefile.frag | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Makefile.frag b/src/Makefile.frag index 454ba60..6598df2 100644 --- a/src/Makefile.frag +++ b/src/Makefile.frag | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | $(srcdir)/sp_config_scanner.c: $(srcdir)/sp_config_scanner.re | 1 | $(srcdir)/sp_config_scanner.c: $(srcdir)/sp_config_scanner.re |
| 2 | if re2c -v |grep ' [23]\.' 2>/dev/null; then \ | 2 | if re2c -v |grep ' [23]\.' 2>/dev/null; then \ |
| 3 | re2c -bc -o $@ $<; \ | 3 | re2c -W --conditions --bit-vectors --no-debug-info --output $@ $<; \ |
| 4 | re2c --no-generation-date --no-version -bci -o $(srcdir)/sp_config_scanner.cached.c $<; \ | 4 | re2c -W --no-generation-date --bit-vectors --no-version --conditions --no-debug-info --output $(srcdir)/sp_config_scanner.cached.c $<; \ |
| 5 | else \ | 5 | else \ |
| 6 | cp $(srcdir)/sp_config_scanner.cached.c $@; \ | 6 | cp $(srcdir)/sp_config_scanner.cached.c $@; \ |
| 7 | fi; | 7 | fi; |
