Skip to content

Commit

Permalink
Add simpler configuration syntax and language specific block markers.
Browse files Browse the repository at this point in the history
Simplifications:
  - allow configurations without `re2c` prefix (for languages other than C/C++
    `re2c` prefix is illogical, as the program has a different name, e.g.
    `re2ocaml` for OCaml, etc.)
  - allow dropping `define:` part
  - allow dropping `variable:` part

So, for example, former `re2c:define:YYFILL` is now `:YYFILL`.

Language-specific block markers are of the form `/*!re2<x>`, where `<x>` is a
word that should match the name of the program (e.g. `ocaml` for re2ocaml), or
else `<x>` can be `c` (historically `/*!re2c` marker was allowed for languages
other than C/C++, we should allow it for backwards compatibility).
  • Loading branch information
skvadrik committed Oct 17, 2024
1 parent 8317afc commit cb247ad
Show file tree
Hide file tree
Showing 47 changed files with 15,633 additions and 14,930 deletions.
534 changes: 267 additions & 267 deletions bootstrap/src/default_syntax_c.cc

Large diffs are not rendered by default.

504 changes: 252 additions & 252 deletions bootstrap/src/default_syntax_d.cc

Large diffs are not rendered by default.

531 changes: 264 additions & 267 deletions bootstrap/src/default_syntax_go.cc

Large diffs are not rendered by default.

503 changes: 251 additions & 252 deletions bootstrap/src/default_syntax_haskell.cc

Large diffs are not rendered by default.

468 changes: 234 additions & 234 deletions bootstrap/src/default_syntax_java.cc

Large diffs are not rendered by default.

470 changes: 235 additions & 235 deletions bootstrap/src/default_syntax_js.cc

Large diffs are not rendered by default.

462 changes: 231 additions & 231 deletions bootstrap/src/default_syntax_ocaml.cc

Large diffs are not rendered by default.

472 changes: 236 additions & 236 deletions bootstrap/src/default_syntax_python.cc

Large diffs are not rendered by default.

484 changes: 242 additions & 242 deletions bootstrap/src/default_syntax_rust.cc

Large diffs are not rendered by default.

487 changes: 242 additions & 245 deletions bootstrap/src/default_syntax_v.cc

Large diffs are not rendered by default.

500 changes: 250 additions & 250 deletions bootstrap/src/default_syntax_zig.cc

Large diffs are not rendered by default.

12,896 changes: 6,481 additions & 6,415 deletions bootstrap/src/parse/conf_lexer.cc

Large diffs are not rendered by default.

5,995 changes: 3,248 additions & 2,747 deletions bootstrap/src/parse/lexer.cc

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions bootstrap/src/parse/lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ struct LexerState {
uint8_t* bot, *lim, *cur, *mar, *ctx, *tok, *ptr, *pos, *eof;

#line 20 "src/parse/lexer.h"
uint8_t* yyt1;uint8_t* yyt2;uint8_t* yyt3;
#line 78 "../src/parse/lexer.re"
uint8_t* yyt1;uint8_t* yyt2;uint8_t* yyt3;uint8_t* yyt4;
#line 79 "../src/parse/lexer.re"


inline LexerState()
Expand All @@ -35,8 +35,8 @@ uint8_t* yyt1;uint8_t* yyt2;uint8_t* yyt3;
eof(nullptr)

#line 38 "src/parse/lexer.h"
, yyt1(lim), yyt2(lim), yyt3(lim)
#line 92 "../src/parse/lexer.re"
, yyt1(lim), yyt2(lim), yyt3(lim), yyt4(lim)
#line 93 "../src/parse/lexer.re"
{
memset(lim, 0, maxfill());
}
Expand All @@ -62,8 +62,8 @@ uint8_t* yyt1;uint8_t* yyt2;uint8_t* yyt3;
pos += offs;

#line 65 "src/parse/lexer.h"
if (yyt1) { yyt1 += offs; }if (yyt2) { yyt2 += offs; }if (yyt3) { yyt3 += offs; }
#line 115 "../src/parse/lexer.re"
if (yyt1) { yyt1 += offs; }if (yyt2) { yyt2 += offs; }if (yyt3) { yyt3 += offs; }if (yyt4) { yyt4 += offs; }
#line 116 "../src/parse/lexer.re"

}

Expand Down
Loading

0 comments on commit cb247ad

Please sign in to comment.