Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cdc5633

Browse files
Add missing & and | operator tokens to the scanner.
1 parent c9bf98b commit cdc5633

File tree

3 files changed

+41
-29
lines changed

3 files changed

+41
-29
lines changed

‎projectm-eval/Scanner.c‎

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
yylloc_param->last_column = yycolumn; \
1717
}
1818

19+
struct prjm_eval_scanner_state;
20+
1921

2022

2123
#define YY_INT_ALIGNED short int
@@ -345,6 +347,7 @@
345347
/* First, we deal with platform-specific or compiler-specific issues. */
346348

347349
/* begin standard C headers. */
350+
348351
#include <stdio.h>
349352
#include <string.h>
350353
#include <errno.h>
@@ -361,8 +364,8 @@
361364

362365
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
363366

364-
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
365-
* if you want the limit (max/min) macros for int types.
367+
/* C++ systems might need __STDC_LIMIT_MACROS defined before including
368+
* <stdint.h>, if you want the limit (max/min) macros for int types.
366369
*/
367370
#ifndef __STDC_LIMIT_MACROS
368371
#define __STDC_LIMIT_MACROS 1
@@ -752,8 +755,8 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
752755
yyg->yy_hold_char = *yy_cp; \
753756
*yy_cp = '0円'; \
754757
yyg->yy_c_buf_p = yy_cp;
755-
#define YY_NUM_RULES 49
756-
#define YY_END_OF_BUFFER 50
758+
#define YY_NUM_RULES 51
759+
#define YY_END_OF_BUFFER 52
757760
/* This struct is not used in this scanner,
758761
but its presence is necessary. */
759762
struct yy_trans_info
@@ -763,10 +766,10 @@ struct yy_trans_info
763766
};
764767
static const flex_int16_t yy_accept[80] =
765768
{ 0,
766-
0, 0, 0, 0, 0, 0, 50, 48, 47, 47,
767-
37, 48, 35, 48, 39, 40, 33, 31, 45, 32,
768-
48, 34, 13, 44, 46, 29, 38, 30, 43, 14,
769-
14, 41, 42, 36, 48, 49, 3, 49, 6, 5,
769+
0, 0, 0, 0, 0, 0, 52, 50, 49, 49,
770+
39, 50, 35, 37, 41, 42, 33, 31, 47, 32,
771+
50, 34, 13, 46, 48, 29, 40, 30, 45, 14,
772+
14, 43, 44, 36, 38, 51, 3, 51, 6, 5,
770773
26, 0, 10, 0, 0, 17, 28, 19, 21, 15,
771774
16, 13, 1, 4, 20, 13, 13, 0, 24, 23,
772775
25, 14, 14, 22, 18, 27, 2, 0, 0, 9,
@@ -886,11 +889,11 @@ static const flex_int16_t yy_chk[169] =
886889

887890

888891
/* Table of booleans, true if rule could match eol. */
889-
static const flex_int32_t yy_rule_can_match_eol[50] =
892+
static const flex_int32_t yy_rule_can_match_eol[52] =
890893
{ 0,
891894
0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
892895
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
893-
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, };
896+
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, };
894897

895898
/* The intent behind this definition is that it'll catch
896899
* any uses of REJECT which flex missed.
@@ -915,15 +918,13 @@ static const flex_int32_t yy_rule_can_match_eol[50] =
915918

916919

917920

918-
919921
#ifndef YY_NO_UNISTD_H
920922
/* Special case for "unistd.h", since it is non-ANSI. We include it way
921923
* down here because we want the user's section 1 to have been scanned first.
922924
* The user has a chance to override it with an option.
923925
*/
924926
#include <unistd.h>
925927
#endif
926-
927928

928929

929930

@@ -1545,58 +1546,66 @@ YY_RULE_SETUP
15451546
YY_BREAK
15461547
case 37:
15471548
YY_RULE_SETUP
1548-
{ return '!'; }
1549+
{ return '%'; }
15491550
YY_BREAK
15501551
case 38:
15511552
YY_RULE_SETUP
1553+
{ return '^'; }
1554+
YY_BREAK
1555+
case 39:
1556+
YY_RULE_SETUP
1557+
{ return '!'; }
1558+
YY_BREAK
1559+
case 40:
1560+
YY_RULE_SETUP
15521561
{ return '='; }
15531562
YY_BREAK
15541563
/* Syntactic elements */
1555-
case 39:
1564+
case 41:
15561565
YY_RULE_SETUP
15571566
{ return '('; }
15581567
YY_BREAK
1559-
case 40:
1568+
case 42:
15601569
YY_RULE_SETUP
15611570
{ return ')'; }
15621571
YY_BREAK
1563-
case 41:
1572+
case 43:
15641573
YY_RULE_SETUP
15651574
{ return '['; }
15661575
YY_BREAK
1567-
case 42:
1576+
case 44:
15681577
YY_RULE_SETUP
15691578
{ return ']'; }
15701579
YY_BREAK
1571-
case 43:
1580+
case 45:
15721581
YY_RULE_SETUP
15731582
{ return '?'; }
15741583
YY_BREAK
1575-
case 44:
1584+
case 46:
15761585
YY_RULE_SETUP
15771586
{ return ':'; }
15781587
YY_BREAK
1579-
case 45:
1588+
case 47:
15801589
YY_RULE_SETUP
15811590
{ return ','; }
15821591
YY_BREAK
15831592
/* Expression terminator */
1584-
case 46:
1593+
case 48:
15851594
YY_RULE_SETUP
15861595
{ return ';'; }
15871596
YY_BREAK
15881597
/* Ignored whitespace */
1589-
case 47:
1590-
/* rule 47 can match eol */
1598+
case 49:
1599+
/* rule 49 can match eol */
15911600
YY_RULE_SETUP
15921601
{ }
15931602
YY_BREAK
15941603
/* All other tokens are invalid */
1595-
case 48:
1604+
case 50:
15961605
YY_RULE_SETUP
15971606
{ return PRJM_EVAL_UNDEF; }
15981607
YY_BREAK
1599-
case 49:
1608+
case 51:
16001609
YY_RULE_SETUP
16011610
ECHO;
16021611
YY_BREAK

‎projectm-eval/Scanner.h‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
yylloc_param->last_column = yycolumn; \
2121
}
2222

23+
struct prjm_eval_scanner_state;
24+
2325

2426

2527
#define YY_INT_ALIGNED short int
@@ -349,6 +351,7 @@
349351
/* First, we deal with platform-specific or compiler-specific issues. */
350352

351353
/* begin standard C headers. */
354+
352355
#include <stdio.h>
353356
#include <string.h>
354357
#include <errno.h>
@@ -365,8 +368,8 @@
365368

366369
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
367370

368-
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
369-
* if you want the limit (max/min) macros for int types.
371+
/* C++ systems might need __STDC_LIMIT_MACROS defined before including
372+
* <stdint.h>, if you want the limit (max/min) macros for int types.
370373
*/
371374
#ifndef __STDC_LIMIT_MACROS
372375
#define __STDC_LIMIT_MACROS 1
@@ -626,15 +629,13 @@ void yyfree ( void * , yyscan_t yyscanner );
626629
#endif
627630

628631

629-
630632
#ifndef YY_NO_UNISTD_H
631633
/* Special case for "unistd.h", since it is non-ANSI. We include it way
632634
* down here because we want the user's section 1 to have been scanned first.
633635
* The user has a chance to override it with an option.
634636
*/
635637
#include <unistd.h>
636638
#endif
637-
638639

639640

640641

‎projectm-eval/Scanner.l‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ NAME [_a-zA-Z][_a-zA-Z0-9]*
105105
"/" { return '/'; }
106106
"%" { return '%'; }
107107
"^" { return '^'; }
108+
"&" { return '%'; }
109+
"|" { return '^'; }
108110
"!" { return '!'; }
109111
"=" { return '='; }
110112

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /