Skip to content

Commit

Permalink
Release 4.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
skvadrik committed Nov 19, 2024
1 parent 7f26edd commit b8a4cdd
Show file tree
Hide file tree
Showing 11 changed files with 2,039 additions and 2,530 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Changelog
4.0x
----

4.0 (2024-??-??)
4.0 (2024-11-19)
~~~~~~~~~~~~~~~~

- Added a generic technique for describing language backends based on the idea
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12)
project(re2c VERSION 3.1 HOMEPAGE_URL "https://re2c.org/")
project(re2c VERSION 4.0 HOMEPAGE_URL "https://re2c.org/")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

Expand Down
124 changes: 61 additions & 63 deletions bootstrap/lib/lex.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by re2c 3.1 */
/* Generated by re2c 4.0 */
#line 1 "../lib/lex.re"
#include <stdint.h>
#include <stdio.h>
Expand Down Expand Up @@ -34,39 +34,39 @@ const uint8_t* yyt1;const uint8_t* yyt2;
#line 35 "lib/lex.cc"
{
uint8_t yych;
static const unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0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, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
yych = *cur;
if (yych <= '>') {
Expand Down Expand Up @@ -152,9 +152,7 @@ const uint8_t* yyt1;const uint8_t* yyt2;
#line 153 "lib/lex.cc"
yy10:
yych = *++cur;
if (yybm[0+yych] & 128) {
goto yy10;
}
if (yybm[0+yych] & 128) goto yy10;
if (yych == ',') goto yy12;
if (yych == '}') goto yy13;
yy11:
Expand All @@ -178,7 +176,7 @@ const uint8_t* yyt1;const uint8_t* yyt2;
yylval->bounds.max = yylval->bounds.min;
return TOKEN_COUNT;
}
#line 182 "lib/lex.cc"
#line 180 "lib/lex.cc"
yy14:
yych = *++cur;
if (yych <= '/') goto yy11;
Expand All @@ -194,7 +192,7 @@ const uint8_t* yyt1;const uint8_t* yyt2;
yylval->bounds.max = Ast::MANY;
return TOKEN_COUNT;
}
#line 198 "lib/lex.cc"
#line 196 "lib/lex.cc"
yy16:
++cur;
x = yyt1;
Expand All @@ -205,23 +203,23 @@ const uint8_t* yyt1;const uint8_t* yyt2;
|| !s_to_u32_unsafe(y, cur - 1, yylval->bounds.max)) goto err_cnt;
return TOKEN_COUNT;
}
#line 209 "lib/lex.cc"
#line 207 "lib/lex.cc"
}
#line 78 "../lib/lex.re"


cls:
if (lex_cls_chr(cur, l) != 0) goto err;

#line 217 "lib/lex.cc"
#line 215 "lib/lex.cc"
{
uint8_t yych;
yych = *(mar = cur);
if (yych == '-') goto yy19;
yy18:
#line 83 "../lib/lex.re"
{ u = l; goto add; }
#line 225 "lib/lex.cc"
#line 223 "lib/lex.cc"
yy19:
yych = *++cur;
if (yych != ']') goto yy20;
Expand All @@ -232,30 +230,30 @@ const uint8_t* yyt1;const uint8_t* yyt2;
cur -= 1;
#line 84 "../lib/lex.re"
{ if (lex_cls_chr(cur, u) != 0) goto err; goto add; }
#line 236 "lib/lex.cc"
#line 234 "lib/lex.cc"
}
#line 85 "../lib/lex.re"

add:
if (l > u) goto err;
ast.temp_ranges.push_back(AstRange(l, u, NOWHERE));

#line 244 "lib/lex.cc"
#line 242 "lib/lex.cc"
{
uint8_t yych;
yych = *cur;
if (yych == ']') goto yy22;
#line 90 "../lib/lex.re"
{ goto cls; }
#line 251 "lib/lex.cc"
#line 249 "lib/lex.cc"
yy22:
++cur;
#line 91 "../lib/lex.re"
{
yylval->regexp = ast.cls(NOWHERE, neg);
return TOKEN_REGEXP;
}
#line 259 "lib/lex.cc"
#line 257 "lib/lex.cc"
}
#line 95 "../lib/lex.re"

Expand All @@ -272,7 +270,7 @@ const uint8_t* yyt1;const uint8_t* yyt2;
int32_t lex_cls_chr(const uint8_t*& cur, uint32_t& c) {
const uint8_t* mar, *p = cur;

#line 276 "lib/lex.cc"
#line 274 "lib/lex.cc"
{
uint8_t yych;
yych = *cur;
Expand All @@ -285,13 +283,13 @@ int32_t lex_cls_chr(const uint8_t*& cur, uint32_t& c) {
++cur;
#line 109 "../lib/lex.re"
{ return 1; }
#line 289 "lib/lex.cc"
#line 287 "lib/lex.cc"
yy25:
++cur;
yy26:
#line 127 "../lib/lex.re"
{ c = cur[-1]; return 0; }
#line 295 "lib/lex.cc"
#line 293 "lib/lex.cc"
yy27:
yych = *++cur;
if (yych <= '9') {
Expand Down Expand Up @@ -320,67 +318,67 @@ int32_t lex_cls_chr(const uint8_t*& cur, uint32_t& c) {
yy29:
#line 116 "../lib/lex.re"
{ c = '\\'_u8; return 0; }
#line 324 "lib/lex.cc"
#line 322 "lib/lex.cc"
yy30:
++cur;
#line 110 "../lib/lex.re"
{ error("collating characters not supported"); return 1; }
#line 329 "lib/lex.cc"
#line 327 "lib/lex.cc"
yy31:
++cur;
#line 111 "../lib/lex.re"
{ error("character classes not supported"); return 1; }
#line 334 "lib/lex.cc"
#line 332 "lib/lex.cc"
yy32:
++cur;
#line 112 "../lib/lex.re"
{ error("equivalence classes not supported"); return 1; }
#line 339 "lib/lex.cc"
#line 337 "lib/lex.cc"
yy33:
++cur;
#line 124 "../lib/lex.re"
{ c = '\\'_u8; return 0; }
#line 344 "lib/lex.cc"
#line 342 "lib/lex.cc"
yy34:
++cur;
#line 125 "../lib/lex.re"
{ c = ']'_u8; return 0; }
#line 349 "lib/lex.cc"
#line 347 "lib/lex.cc"
yy35:
++cur;
#line 117 "../lib/lex.re"
{ c = '\a'_u8; return 0; }
#line 354 "lib/lex.cc"
#line 352 "lib/lex.cc"
yy36:
++cur;
#line 118 "../lib/lex.re"
{ c = '\b'_u8; return 0; }
#line 359 "lib/lex.cc"
#line 357 "lib/lex.cc"
yy37:
++cur;
#line 119 "../lib/lex.re"
{ c = '\f'_u8; return 0; }
#line 364 "lib/lex.cc"
#line 362 "lib/lex.cc"
yy38:
++cur;
#line 120 "../lib/lex.re"
{ c = '\n'_u8; return 0; }
#line 369 "lib/lex.cc"
#line 367 "lib/lex.cc"
yy39:
++cur;
#line 121 "../lib/lex.re"
{ c = '\r'_u8; return 0; }
#line 374 "lib/lex.cc"
#line 372 "lib/lex.cc"
yy40:
++cur;
#line 122 "../lib/lex.re"
{ c = '\t'_u8; return 0; }
#line 379 "lib/lex.cc"
#line 377 "lib/lex.cc"
yy41:
++cur;
#line 123 "../lib/lex.re"
{ c = '\v'_u8; return 0; }
#line 384 "lib/lex.cc"
#line 382 "lib/lex.cc"
yy42:
yych = *++cur;
if (yych <= '@') {
Expand Down Expand Up @@ -408,7 +406,7 @@ int32_t lex_cls_chr(const uint8_t*& cur, uint32_t& c) {
++cur;
#line 114 "../lib/lex.re"
{ c = unesc_hex(p, cur); return 0; }
#line 412 "lib/lex.cc"
#line 410 "lib/lex.cc"
}
#line 128 "../lib/lex.re"

Expand Down
Loading

0 comments on commit b8a4cdd

Please sign in to comment.