From 631429b6a6e69f6e2a923433df724acadb29828f Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 30 Dec 2018 10:30:19 +0000 Subject: [PATCH] Correctly parse -I option with or without space before the argument. --- re2c/bootstrap/src/conf/parse_opts.cc | 502 +++++++++++++------------- re2c/src/conf/parse_opts.re | 12 +- 2 files changed, 261 insertions(+), 253 deletions(-) diff --git a/re2c/bootstrap/src/conf/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc index 324192d5..56f65380 100644 --- a/re2c/bootstrap/src/conf/parse_opts.cc +++ b/re2c/bootstrap/src/conf/parse_opts.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Thu Dec 27 23:18:50 2018 */ +/* Generated by re2c 1.1.1 on Sun Dec 30 10:30:10 2018 */ #line 1 "../src/conf/parse_opts.re" #include "src/code/input_api.h" #include "src/conf/msg.h" @@ -18,11 +18,10 @@ static inline bool next (char * & arg, char ** & argv) parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Warn &warn) { #define YYCTYPE unsigned char - char * YYCURSOR; - char * YYMARKER; + char *YYCURSOR, *YYMARKER, *p; Warn::option_t option; -#line 29 "../src/conf/parse_opts.re" +#line 28 "../src/conf/parse_opts.re" opt: @@ -31,7 +30,7 @@ opt: goto end; } -#line 35 "src/conf/parse_opts.cc" +#line 34 "src/conf/parse_opts.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -75,12 +74,12 @@ opt: goto yy4; yy2: ++YYCURSOR; -#line 38 "../src/conf/parse_opts.re" +#line 37 "../src/conf/parse_opts.re" { error ("bad option: %s", *argv); return EXIT_FAIL; } -#line 84 "src/conf/parse_opts.cc" +#line 83 "src/conf/parse_opts.cc" yy4: yych = (YYCTYPE)*++YYCURSOR; if (yybm[0+yych] & 128) { @@ -95,25 +94,25 @@ yy6: } else { if (yych == 'W') goto yy14; } -#line 61 "../src/conf/parse_opts.re" +#line 60 "../src/conf/parse_opts.re" { goto opt_short; } -#line 101 "src/conf/parse_opts.cc" +#line 100 "src/conf/parse_opts.cc" yy8: ++YYCURSOR; -#line 59 "../src/conf/parse_opts.re" +#line 58 "../src/conf/parse_opts.re" { if (!opts.source (*argv)) return EXIT_FAIL; goto opt; } -#line 106 "src/conf/parse_opts.cc" +#line 105 "src/conf/parse_opts.cc" yy10: ++YYCURSOR; -#line 58 "../src/conf/parse_opts.re" +#line 57 "../src/conf/parse_opts.re" { if (!opts.source ("")) return EXIT_FAIL; goto opt; } -#line 111 "src/conf/parse_opts.cc" +#line 110 "src/conf/parse_opts.cc" yy12: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy16; -#line 62 "../src/conf/parse_opts.re" +#line 61 "../src/conf/parse_opts.re" { goto opt_long; } -#line 117 "src/conf/parse_opts.cc" +#line 116 "src/conf/parse_opts.cc" yy14: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -124,12 +123,12 @@ yy14: if (yych == 'n') goto yy22; } yy15: -#line 66 "../src/conf/parse_opts.re" +#line 65 "../src/conf/parse_opts.re" { option = Warn::W; goto opt_warn; } -#line 130 "src/conf/parse_opts.cc" +#line 129 "src/conf/parse_opts.cc" yy16: ++YYCURSOR; -#line 44 "../src/conf/parse_opts.re" +#line 43 "../src/conf/parse_opts.re" { // all remaining arguments are non-options // so they must be input files @@ -143,12 +142,12 @@ yy16: } goto end; } -#line 147 "src/conf/parse_opts.cc" +#line 146 "src/conf/parse_opts.cc" yy18: ++YYCURSOR; -#line 64 "../src/conf/parse_opts.re" +#line 63 "../src/conf/parse_opts.re" { warn.set_all (); goto opt; } -#line 152 "src/conf/parse_opts.cc" +#line 151 "src/conf/parse_opts.cc" yy20: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy23; @@ -180,9 +179,9 @@ yy26: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'e') goto yy29; yy27: -#line 67 "../src/conf/parse_opts.re" +#line 66 "../src/conf/parse_opts.re" { option = Warn::WNO; goto opt_warn; } -#line 186 "src/conf/parse_opts.cc" +#line 185 "src/conf/parse_opts.cc" yy28: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy30; @@ -202,14 +201,14 @@ yy31: goto yy21; yy32: ++YYCURSOR; -#line 65 "../src/conf/parse_opts.re" +#line 64 "../src/conf/parse_opts.re" { warn.set_all_error (); goto opt; } -#line 208 "src/conf/parse_opts.cc" +#line 207 "src/conf/parse_opts.cc" yy34: ++YYCURSOR; -#line 68 "../src/conf/parse_opts.re" +#line 67 "../src/conf/parse_opts.re" { option = Warn::WERROR; goto opt_warn; } -#line 213 "src/conf/parse_opts.cc" +#line 212 "src/conf/parse_opts.cc" yy36: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'o') goto yy21; @@ -218,16 +217,16 @@ yy36: yych = (YYCTYPE)*++YYCURSOR; if (yych != '-') goto yy21; ++YYCURSOR; -#line 69 "../src/conf/parse_opts.re" +#line 68 "../src/conf/parse_opts.re" { option = Warn::WNOERROR; goto opt_warn; } -#line 224 "src/conf/parse_opts.cc" +#line 223 "src/conf/parse_opts.cc" } -#line 70 "../src/conf/parse_opts.re" +#line 69 "../src/conf/parse_opts.re" opt_warn: -#line 231 "src/conf/parse_opts.cc" +#line 230 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -243,12 +242,12 @@ opt_warn: yy43: ++YYCURSOR; yy44: -#line 75 "../src/conf/parse_opts.re" +#line 74 "../src/conf/parse_opts.re" { error ("bad warning: %s", *argv); return EXIT_FAIL; } -#line 252 "src/conf/parse_opts.cc" +#line 251 "src/conf/parse_opts.cc" yy45: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'o') goto yy51; @@ -675,9 +674,9 @@ yy150: goto yy52; yy151: ++YYCURSOR; -#line 83 "../src/conf/parse_opts.re" +#line 82 "../src/conf/parse_opts.re" { warn.set (Warn::SWAPPED_RANGE, option); goto opt; } -#line 681 "src/conf/parse_opts.cc" +#line 680 "src/conf/parse_opts.cc" yy153: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy160; @@ -716,14 +715,14 @@ yy161: goto yy52; yy162: ++YYCURSOR; -#line 86 "../src/conf/parse_opts.re" +#line 85 "../src/conf/parse_opts.re" { warn.set (Warn::USELESS_ESCAPE, option); goto opt; } -#line 722 "src/conf/parse_opts.cc" +#line 721 "src/conf/parse_opts.cc" yy164: ++YYCURSOR; -#line 79 "../src/conf/parse_opts.re" +#line 78 "../src/conf/parse_opts.re" { warn.set (Warn::CONDITION_ORDER, option); goto opt; } -#line 727 "src/conf/parse_opts.cc" +#line 726 "src/conf/parse_opts.cc" yy166: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'c') goto yy171; @@ -782,18 +781,18 @@ yy179: goto yy52; yy180: ++YYCURSOR; -#line 85 "../src/conf/parse_opts.re" +#line 84 "../src/conf/parse_opts.re" { warn.set (Warn::UNREACHABLE_RULES, option); goto opt; } -#line 788 "src/conf/parse_opts.cc" +#line 787 "src/conf/parse_opts.cc" yy182: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy187; goto yy52; yy183: ++YYCURSOR; -#line 81 "../src/conf/parse_opts.re" +#line 80 "../src/conf/parse_opts.re" { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; } -#line 797 "src/conf/parse_opts.cc" +#line 796 "src/conf/parse_opts.cc" yy185: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'g') goto yy188; @@ -828,28 +827,28 @@ yy192: goto yy52; yy193: ++YYCURSOR; -#line 80 "../src/conf/parse_opts.re" +#line 79 "../src/conf/parse_opts.re" { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; } -#line 834 "src/conf/parse_opts.cc" +#line 833 "src/conf/parse_opts.cc" yy195: ++YYCURSOR; -#line 82 "../src/conf/parse_opts.re" +#line 81 "../src/conf/parse_opts.re" { warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; } -#line 839 "src/conf/parse_opts.cc" +#line 838 "src/conf/parse_opts.cc" yy197: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy52; ++YYCURSOR; -#line 84 "../src/conf/parse_opts.re" +#line 83 "../src/conf/parse_opts.re" { warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; } -#line 846 "src/conf/parse_opts.cc" +#line 845 "src/conf/parse_opts.cc" } -#line 87 "../src/conf/parse_opts.re" +#line 86 "../src/conf/parse_opts.re" opt_short: -#line 853 "src/conf/parse_opts.cc" +#line 852 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -937,167 +936,167 @@ opt_short: } } ++YYCURSOR; -#line 96 "../src/conf/parse_opts.re" +#line 95 "../src/conf/parse_opts.re" { goto opt; } -#line 943 "src/conf/parse_opts.cc" +#line 942 "src/conf/parse_opts.cc" yy204: ++YYCURSOR; -#line 92 "../src/conf/parse_opts.re" +#line 91 "../src/conf/parse_opts.re" { error ("bad short option: %s", *argv); return EXIT_FAIL; } -#line 951 "src/conf/parse_opts.cc" +#line 950 "src/conf/parse_opts.cc" yy206: ++YYCURSOR; -#line 127 "../src/conf/parse_opts.re" +#line 126 "../src/conf/parse_opts.re" { goto opt_short; } -#line 956 "src/conf/parse_opts.cc" +#line 955 "src/conf/parse_opts.cc" yy208: ++YYCURSOR; -#line 122 "../src/conf/parse_opts.re" +#line 121 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UTF8); goto opt_short; } -#line 961 "src/conf/parse_opts.cc" +#line 960 "src/conf/parse_opts.cc" yy210: ++YYCURSOR; -#line 97 "../src/conf/parse_opts.re" +#line 96 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 966 "src/conf/parse_opts.cc" +#line 965 "src/conf/parse_opts.cc" yy212: ++YYCURSOR; -#line 102 "../src/conf/parse_opts.re" +#line 101 "../src/conf/parse_opts.re" { globopts.target = TARGET_DOT; goto opt_short; } -#line 971 "src/conf/parse_opts.cc" +#line 970 "src/conf/parse_opts.cc" yy214: ++YYCURSOR; -#line 104 "../src/conf/parse_opts.re" +#line 103 "../src/conf/parse_opts.re" { globopts.FFlag = true; goto opt_short; } -#line 976 "src/conf/parse_opts.cc" +#line 975 "src/conf/parse_opts.cc" yy216: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy256; -#line 109 "../src/conf/parse_opts.re" +#line 108 "../src/conf/parse_opts.re" { goto opt_incpath; } -#line 982 "src/conf/parse_opts.cc" +#line 981 "src/conf/parse_opts.cc" yy218: ++YYCURSOR; -#line 117 "../src/conf/parse_opts.re" +#line 116 "../src/conf/parse_opts.re" { opts.set_posix_captures(true); goto opt_short; } -#line 987 "src/conf/parse_opts.cc" +#line 986 "src/conf/parse_opts.cc" yy220: ++YYCURSOR; -#line 106 "../src/conf/parse_opts.re" +#line 105 "../src/conf/parse_opts.re" { globopts.target = TARGET_SKELETON; goto opt_short; } -#line 992 "src/conf/parse_opts.cc" +#line 991 "src/conf/parse_opts.cc" yy222: ++YYCURSOR; -#line 116 "../src/conf/parse_opts.re" +#line 115 "../src/conf/parse_opts.re" { opts.set_tags(true); goto opt_short; } -#line 997 "src/conf/parse_opts.cc" +#line 996 "src/conf/parse_opts.cc" yy224: ++YYCURSOR; -#line 99 "../src/conf/parse_opts.re" +#line 98 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 1002 "src/conf/parse_opts.cc" +#line 1001 "src/conf/parse_opts.cc" yy226: ++YYCURSOR; -#line 111 "../src/conf/parse_opts.re" +#line 110 "../src/conf/parse_opts.re" { opts.set_bFlag(true); goto opt_short; } -#line 1007 "src/conf/parse_opts.cc" +#line 1006 "src/conf/parse_opts.cc" yy228: ++YYCURSOR; -#line 101 "../src/conf/parse_opts.re" +#line 100 "../src/conf/parse_opts.re" { globopts.cFlag = true; goto opt_short; } -#line 1012 "src/conf/parse_opts.cc" +#line 1011 "src/conf/parse_opts.cc" yy230: ++YYCURSOR; -#line 112 "../src/conf/parse_opts.re" +#line 111 "../src/conf/parse_opts.re" { opts.set_dFlag(true); goto opt_short; } -#line 1017 "src/conf/parse_opts.cc" +#line 1016 "src/conf/parse_opts.cc" yy232: ++YYCURSOR; -#line 118 "../src/conf/parse_opts.re" +#line 117 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::EBCDIC); goto opt_short; } -#line 1022 "src/conf/parse_opts.cc" +#line 1021 "src/conf/parse_opts.cc" yy234: ++YYCURSOR; -#line 103 "../src/conf/parse_opts.re" +#line 102 "../src/conf/parse_opts.re" { globopts.fFlag = true; goto opt_short; } -#line 1027 "src/conf/parse_opts.cc" +#line 1026 "src/conf/parse_opts.cc" yy236: ++YYCURSOR; -#line 113 "../src/conf/parse_opts.re" +#line 112 "../src/conf/parse_opts.re" { opts.set_gFlag(true); goto opt_short; } -#line 1032 "src/conf/parse_opts.cc" +#line 1031 "src/conf/parse_opts.cc" yy238: ++YYCURSOR; -#line 114 "../src/conf/parse_opts.re" +#line 113 "../src/conf/parse_opts.re" { opts.set_iFlag(true); goto opt_short; } -#line 1037 "src/conf/parse_opts.cc" +#line 1036 "src/conf/parse_opts.cc" yy240: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy258; -#line 124 "../src/conf/parse_opts.re" +#line 123 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_output; } -#line 1043 "src/conf/parse_opts.cc" +#line 1042 "src/conf/parse_opts.cc" yy242: ++YYCURSOR; -#line 105 "../src/conf/parse_opts.re" +#line 104 "../src/conf/parse_opts.re" { globopts.rFlag = true; goto opt_short; } -#line 1048 "src/conf/parse_opts.cc" +#line 1047 "src/conf/parse_opts.cc" yy244: ++YYCURSOR; -#line 115 "../src/conf/parse_opts.re" +#line 114 "../src/conf/parse_opts.re" { opts.set_sFlag(true); goto opt_short; } -#line 1053 "src/conf/parse_opts.cc" +#line 1052 "src/conf/parse_opts.cc" yy246: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy260; -#line 126 "../src/conf/parse_opts.re" +#line 125 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_header; } -#line 1059 "src/conf/parse_opts.cc" +#line 1058 "src/conf/parse_opts.cc" yy248: ++YYCURSOR; -#line 119 "../src/conf/parse_opts.re" +#line 118 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UTF32); goto opt_short; } -#line 1064 "src/conf/parse_opts.cc" +#line 1063 "src/conf/parse_opts.cc" yy250: ++YYCURSOR; -#line 98 "../src/conf/parse_opts.re" +#line 97 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 1069 "src/conf/parse_opts.cc" +#line 1068 "src/conf/parse_opts.cc" yy252: ++YYCURSOR; -#line 120 "../src/conf/parse_opts.re" +#line 119 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UCS2); goto opt_short; } -#line 1074 "src/conf/parse_opts.cc" +#line 1073 "src/conf/parse_opts.cc" yy254: ++YYCURSOR; -#line 121 "../src/conf/parse_opts.re" +#line 120 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UTF16); goto opt_short; } -#line 1079 "src/conf/parse_opts.cc" +#line 1078 "src/conf/parse_opts.cc" yy256: ++YYCURSOR; -#line 108 "../src/conf/parse_opts.re" +#line 107 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-I"); return EXIT_FAIL; } goto opt_incpath; } -#line 1084 "src/conf/parse_opts.cc" +#line 1083 "src/conf/parse_opts.cc" yy258: ++YYCURSOR; -#line 123 "../src/conf/parse_opts.re" +#line 122 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 1089 "src/conf/parse_opts.cc" +#line 1088 "src/conf/parse_opts.cc" yy260: ++YYCURSOR; -#line 125 "../src/conf/parse_opts.re" +#line 124 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 1094 "src/conf/parse_opts.cc" +#line 1093 "src/conf/parse_opts.cc" } -#line 128 "../src/conf/parse_opts.re" +#line 127 "../src/conf/parse_opts.re" opt_long: -#line 1101 "src/conf/parse_opts.cc" +#line 1100 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -1123,12 +1122,12 @@ opt_long: yy264: ++YYCURSOR; yy265: -#line 133 "../src/conf/parse_opts.re" +#line 132 "../src/conf/parse_opts.re" { error ("bad long option: %s", *argv); return EXIT_FAIL; } -#line 1132 "src/conf/parse_opts.cc" +#line 1131 "src/conf/parse_opts.cc" yy266: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'i') goto yy282; @@ -1492,9 +1491,9 @@ yy347: goto yy283; yy348: ++YYCURSOR; -#line 162 "../src/conf/parse_opts.re" +#line 161 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::EBCDIC); goto opt; } -#line 1498 "src/conf/parse_opts.cc" +#line 1497 "src/conf/parse_opts.cc" yy350: yych = (YYCTYPE)*++YYCURSOR; if (yych == '-') goto yy384; @@ -1656,9 +1655,9 @@ yy387: goto yy283; yy388: ++YYCURSOR; -#line 137 "../src/conf/parse_opts.re" +#line 136 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 1662 "src/conf/parse_opts.cc" +#line 1661 "src/conf/parse_opts.cc" yy390: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy427; @@ -1717,9 +1716,9 @@ yy403: goto yy283; yy404: ++YYCURSOR; -#line 157 "../src/conf/parse_opts.re" +#line 156 "../src/conf/parse_opts.re" { opts.set_tags (true); goto opt; } -#line 1723 "src/conf/parse_opts.cc" +#line 1722 "src/conf/parse_opts.cc" yy406: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'h') goto yy442; @@ -1806,9 +1805,9 @@ yy426: goto yy283; yy427: ++YYCURSOR; -#line 170 "../src/conf/parse_opts.re" +#line 169 "../src/conf/parse_opts.re" { goto opt_input; } -#line 1812 "src/conf/parse_opts.cc" +#line 1811 "src/conf/parse_opts.cc" yy429: yych = (YYCTYPE)*++YYCURSOR; if (yych == '-') goto yy464; @@ -1875,9 +1874,9 @@ yy444: goto yy283; yy445: ++YYCURSOR; -#line 166 "../src/conf/parse_opts.re" +#line 165 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UTF8); goto opt; } -#line 1881 "src/conf/parse_opts.cc" +#line 1880 "src/conf/parse_opts.cc" yy447: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy482; @@ -1973,9 +1972,9 @@ yy469: goto yy283; yy470: ++YYCURSOR; -#line 167 "../src/conf/parse_opts.re" +#line 166 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 1979 "src/conf/parse_opts.cc" +#line 1978 "src/conf/parse_opts.cc" yy472: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'a') goto yy507; @@ -2010,14 +2009,14 @@ yy479: goto yy283; yy480: ++YYCURSOR; -#line 165 "../src/conf/parse_opts.re" +#line 164 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UTF16); goto opt; } -#line 2016 "src/conf/parse_opts.cc" +#line 2015 "src/conf/parse_opts.cc" yy482: ++YYCURSOR; -#line 139 "../src/conf/parse_opts.re" +#line 138 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 2021 "src/conf/parse_opts.cc" +#line 2020 "src/conf/parse_opts.cc" yy484: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy516; @@ -2140,14 +2139,14 @@ yy513: goto yy283; yy514: ++YYCURSOR; -#line 163 "../src/conf/parse_opts.re" +#line 162 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UTF32); goto opt; } -#line 2146 "src/conf/parse_opts.cc" +#line 2145 "src/conf/parse_opts.cc" yy516: ++YYCURSOR; -#line 138 "../src/conf/parse_opts.re" +#line 137 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 2151 "src/conf/parse_opts.cc" +#line 2150 "src/conf/parse_opts.cc" yy518: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy550; @@ -2195,18 +2194,18 @@ yy527: } yy528: ++YYCURSOR; -#line 175 "../src/conf/parse_opts.re" +#line 174 "../src/conf/parse_opts.re" { globopts.dump_nfa = true; goto opt; } -#line 2201 "src/conf/parse_opts.cc" +#line 2200 "src/conf/parse_opts.cc" yy530: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'p') goto yy564; goto yy283; yy531: ++YYCURSOR; -#line 142 "../src/conf/parse_opts.re" +#line 141 "../src/conf/parse_opts.re" { globopts.target = TARGET_DOT; goto opt; } -#line 2210 "src/conf/parse_opts.cc" +#line 2209 "src/conf/parse_opts.cc" yy533: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy565; @@ -2249,18 +2248,18 @@ yy542: goto yy283; yy543: ++YYCURSOR; -#line 145 "../src/conf/parse_opts.re" +#line 144 "../src/conf/parse_opts.re" { globopts.rFlag = true; goto opt; } -#line 2255 "src/conf/parse_opts.cc" +#line 2254 "src/conf/parse_opts.cc" yy545: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy575; goto yy283; yy546: ++YYCURSOR; -#line 148 "../src/conf/parse_opts.re" +#line 147 "../src/conf/parse_opts.re" { globopts.target = TARGET_SKELETON; goto opt; } -#line 2264 "src/conf/parse_opts.cc" +#line 2263 "src/conf/parse_opts.cc" yy548: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy576; @@ -2303,9 +2302,9 @@ yy557: goto yy283; yy558: ++YYCURSOR; -#line 180 "../src/conf/parse_opts.re" +#line 179 "../src/conf/parse_opts.re" { globopts.dump_adfa = true; goto opt; } -#line 2309 "src/conf/parse_opts.cc" +#line 2308 "src/conf/parse_opts.cc" yy560: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy587; @@ -2400,9 +2399,9 @@ yy582: goto yy283; yy583: ++YYCURSOR; -#line 141 "../src/conf/parse_opts.re" +#line 140 "../src/conf/parse_opts.re" { globopts.cFlag = true; goto opt; } -#line 2406 "src/conf/parse_opts.cc" +#line 2405 "src/conf/parse_opts.cc" yy585: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy615; @@ -2429,9 +2428,9 @@ yy590: goto yy283; yy591: ++YYCURSOR; -#line 161 "../src/conf/parse_opts.re" +#line 160 "../src/conf/parse_opts.re" { opts.set_eager_skip(true); goto opt; } -#line 2435 "src/conf/parse_opts.cc" +#line 2434 "src/conf/parse_opts.cc" yy593: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy621; @@ -2446,9 +2445,9 @@ yy595: goto yy283; yy596: ++YYCURSOR; -#line 154 "../src/conf/parse_opts.re" +#line 153 "../src/conf/parse_opts.re" { opts.set_sFlag (true); goto opt; } -#line 2452 "src/conf/parse_opts.cc" +#line 2451 "src/conf/parse_opts.cc" yy598: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'f') goto yy626; @@ -2467,9 +2466,9 @@ yy601: goto yy283; yy602: ++YYCURSOR; -#line 147 "../src/conf/parse_opts.re" +#line 146 "../src/conf/parse_opts.re" { globopts.version = false; goto opt; } -#line 2473 "src/conf/parse_opts.cc" +#line 2472 "src/conf/parse_opts.cc" yy604: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy630; @@ -2488,14 +2487,14 @@ yy607: goto yy283; yy608: ++YYCURSOR; -#line 164 "../src/conf/parse_opts.re" +#line 163 "../src/conf/parse_opts.re" { opts.set_encoding(Enc::UCS2); goto opt; } -#line 2494 "src/conf/parse_opts.cc" +#line 2493 "src/conf/parse_opts.cc" yy610: ++YYCURSOR; -#line 150 "../src/conf/parse_opts.re" +#line 149 "../src/conf/parse_opts.re" { opts.set_bFlag (true); goto opt; } -#line 2499 "src/conf/parse_opts.cc" +#line 2498 "src/conf/parse_opts.cc" yy612: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy636; @@ -2534,18 +2533,18 @@ yy620: goto yy283; yy621: ++YYCURSOR; -#line 171 "../src/conf/parse_opts.re" +#line 170 "../src/conf/parse_opts.re" { goto opt_empty_class; } -#line 2540 "src/conf/parse_opts.cc" +#line 2539 "src/conf/parse_opts.cc" yy623: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy649; goto yy283; yy624: ++YYCURSOR; -#line 144 "../src/conf/parse_opts.re" +#line 143 "../src/conf/parse_opts.re" { globopts.FFlag = true; goto opt; } -#line 2549 "src/conf/parse_opts.cc" +#line 2548 "src/conf/parse_opts.cc" yy626: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'o') goto yy650; @@ -2568,18 +2567,18 @@ yy630: goto yy283; yy631: ++YYCURSOR; -#line 173 "../src/conf/parse_opts.re" +#line 172 "../src/conf/parse_opts.re" { goto opt; } -#line 2574 "src/conf/parse_opts.cc" +#line 2573 "src/conf/parse_opts.cc" yy633: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy656; goto yy283; yy634: ++YYCURSOR; -#line 168 "../src/conf/parse_opts.re" +#line 167 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 2583 "src/conf/parse_opts.cc" +#line 2582 "src/conf/parse_opts.cc" yy636: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy657; @@ -2594,28 +2593,28 @@ yy638: goto yy283; yy639: ++YYCURSOR; -#line 151 "../src/conf/parse_opts.re" +#line 150 "../src/conf/parse_opts.re" { opts.set_dFlag (true); goto opt; } -#line 2600 "src/conf/parse_opts.cc" +#line 2599 "src/conf/parse_opts.cc" yy641: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy661; goto yy283; yy642: ++YYCURSOR; -#line 177 "../src/conf/parse_opts.re" +#line 176 "../src/conf/parse_opts.re" { globopts.dump_dfa_det = true; goto opt; } -#line 2609 "src/conf/parse_opts.cc" +#line 2608 "src/conf/parse_opts.cc" yy644: ++YYCURSOR; -#line 179 "../src/conf/parse_opts.re" +#line 178 "../src/conf/parse_opts.re" { globopts.dump_dfa_min = true; goto opt; } -#line 2614 "src/conf/parse_opts.cc" +#line 2613 "src/conf/parse_opts.cc" yy646: ++YYCURSOR; -#line 176 "../src/conf/parse_opts.re" +#line 175 "../src/conf/parse_opts.re" { globopts.dump_dfa_raw = true; goto opt; } -#line 2619 "src/conf/parse_opts.cc" +#line 2618 "src/conf/parse_opts.cc" yy648: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'p') goto yy662; @@ -2634,9 +2633,9 @@ yy651: goto yy283; yy652: ++YYCURSOR; -#line 159 "../src/conf/parse_opts.re" +#line 158 "../src/conf/parse_opts.re" { opts.set_lookahead(false); goto opt; } -#line 2640 "src/conf/parse_opts.cc" +#line 2639 "src/conf/parse_opts.cc" yy654: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'a') goto yy667; @@ -2655,9 +2654,9 @@ yy657: goto yy283; yy658: ++YYCURSOR; -#line 156 "../src/conf/parse_opts.re" +#line 155 "../src/conf/parse_opts.re" { opts.set_bCaseInverted (true); goto opt; } -#line 2661 "src/conf/parse_opts.cc" +#line 2660 "src/conf/parse_opts.cc" yy660: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy671; @@ -2676,9 +2675,9 @@ yy663: goto yy283; yy664: ++YYCURSOR; -#line 153 "../src/conf/parse_opts.re" +#line 152 "../src/conf/parse_opts.re" { opts.set_iFlag (true); goto opt; } -#line 2682 "src/conf/parse_opts.cc" +#line 2681 "src/conf/parse_opts.cc" yy666: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'd') goto yy676; @@ -2701,9 +2700,9 @@ yy670: goto yy283; yy671: ++YYCURSOR; -#line 152 "../src/conf/parse_opts.re" +#line 151 "../src/conf/parse_opts.re" { opts.set_gFlag (true); goto opt; } -#line 2707 "src/conf/parse_opts.cc" +#line 2706 "src/conf/parse_opts.cc" yy673: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'n') goto yy683; @@ -2726,14 +2725,14 @@ yy677: goto yy283; yy678: ++YYCURSOR; -#line 158 "../src/conf/parse_opts.re" +#line 157 "../src/conf/parse_opts.re" { opts.set_posix_captures(true); goto opt; } -#line 2732 "src/conf/parse_opts.cc" +#line 2731 "src/conf/parse_opts.cc" yy680: ++YYCURSOR; -#line 143 "../src/conf/parse_opts.re" +#line 142 "../src/conf/parse_opts.re" { globopts.fFlag = true; goto opt; } -#line 2737 "src/conf/parse_opts.cc" +#line 2736 "src/conf/parse_opts.cc" yy682: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy690; @@ -2744,14 +2743,14 @@ yy683: goto yy283; yy684: ++YYCURSOR; -#line 178 "../src/conf/parse_opts.re" +#line 177 "../src/conf/parse_opts.re" { globopts.dump_dfa_tagopt = true; goto opt; } -#line 2750 "src/conf/parse_opts.cc" +#line 2749 "src/conf/parse_opts.cc" yy686: ++YYCURSOR; -#line 169 "../src/conf/parse_opts.re" +#line 168 "../src/conf/parse_opts.re" { goto opt_encoding_policy; } -#line 2755 "src/conf/parse_opts.cc" +#line 2754 "src/conf/parse_opts.cc" yy688: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy694; @@ -2762,37 +2761,37 @@ yy689: goto yy283; yy690: ++YYCURSOR; -#line 155 "../src/conf/parse_opts.re" +#line 154 "../src/conf/parse_opts.re" { opts.set_bCaseInsensitive (true); goto opt; } -#line 2768 "src/conf/parse_opts.cc" +#line 2767 "src/conf/parse_opts.cc" yy692: ++YYCURSOR; -#line 172 "../src/conf/parse_opts.re" +#line 171 "../src/conf/parse_opts.re" { goto opt_dfa_minimization; } -#line 2773 "src/conf/parse_opts.cc" +#line 2772 "src/conf/parse_opts.cc" yy694: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy697; goto yy283; yy695: ++YYCURSOR; -#line 160 "../src/conf/parse_opts.re" +#line 159 "../src/conf/parse_opts.re" { opts.set_optimize_tags(false); goto opt; } -#line 2782 "src/conf/parse_opts.cc" +#line 2781 "src/conf/parse_opts.cc" yy697: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy283; ++YYCURSOR; -#line 146 "../src/conf/parse_opts.re" +#line 145 "../src/conf/parse_opts.re" { globopts.bNoGenerationDate = true; goto opt; } -#line 2789 "src/conf/parse_opts.cc" +#line 2788 "src/conf/parse_opts.cc" } -#line 181 "../src/conf/parse_opts.re" +#line 180 "../src/conf/parse_opts.re" opt_output: -#line 2796 "src/conf/parse_opts.cc" +#line 2795 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2834,28 +2833,28 @@ opt_output: if (yych != '-') goto yy704; yy702: ++YYCURSOR; -#line 186 "../src/conf/parse_opts.re" +#line 185 "../src/conf/parse_opts.re" { error ("bad argument to option -o, --output: %s", *argv); return EXIT_FAIL; } -#line 2843 "src/conf/parse_opts.cc" +#line 2842 "src/conf/parse_opts.cc" yy704: yych = (YYCTYPE)*++YYCURSOR; if (yybm[0+yych] & 128) { goto yy704; } ++YYCURSOR; -#line 190 "../src/conf/parse_opts.re" +#line 189 "../src/conf/parse_opts.re" { opts.set_output_file (*argv); goto opt; } -#line 2852 "src/conf/parse_opts.cc" +#line 2851 "src/conf/parse_opts.cc" } -#line 191 "../src/conf/parse_opts.re" +#line 190 "../src/conf/parse_opts.re" opt_header: -#line 2859 "src/conf/parse_opts.cc" +#line 2858 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2897,26 +2896,27 @@ opt_header: if (yych != '-') goto yy712; yy710: ++YYCURSOR; -#line 196 "../src/conf/parse_opts.re" +#line 195 "../src/conf/parse_opts.re" { error ("bad argument to option -t, --type-header: %s", *argv); return EXIT_FAIL; } -#line 2906 "src/conf/parse_opts.cc" +#line 2905 "src/conf/parse_opts.cc" yy712: yych = (YYCTYPE)*++YYCURSOR; if (yybm[0+yych] & 128) { goto yy712; } ++YYCURSOR; -#line 200 "../src/conf/parse_opts.re" +#line 199 "../src/conf/parse_opts.re" { opts.set_header_file (*argv); goto opt; } -#line 2915 "src/conf/parse_opts.cc" +#line 2914 "src/conf/parse_opts.cc" } -#line 201 "../src/conf/parse_opts.re" +#line 200 "../src/conf/parse_opts.re" opt_incpath: + p = YYCURSOR; #line 2922 "src/conf/parse_opts.cc" { @@ -2973,10 +2973,14 @@ yy720: } ++YYCURSOR; #line 209 "../src/conf/parse_opts.re" - { globopts.incpaths.push_back(*argv); goto opt; } -#line 2978 "src/conf/parse_opts.cc" + { + std::string name(p, static_cast(YYCURSOR - p - 1)); + globopts.incpaths.push_back(name); + goto opt; + } +#line 2982 "src/conf/parse_opts.cc" } -#line 210 "../src/conf/parse_opts.re" +#line 214 "../src/conf/parse_opts.re" opt_encoding_policy: @@ -2986,7 +2990,7 @@ opt_encoding_policy: return EXIT_FAIL; } -#line 2990 "src/conf/parse_opts.cc" +#line 2994 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -2998,12 +3002,12 @@ opt_encoding_policy: } ++YYCURSOR; yy727: -#line 220 "../src/conf/parse_opts.re" +#line 224 "../src/conf/parse_opts.re" { error ("bad argument to option --encoding-policy (expected: ignore | substitute | fail): %s", *argv); return EXIT_FAIL; } -#line 3007 "src/conf/parse_opts.cc" +#line 3011 "src/conf/parse_opts.cc" yy728: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'a') goto yy731; @@ -3056,9 +3060,9 @@ yy740: goto yy732; yy741: ++YYCURSOR; -#line 226 "../src/conf/parse_opts.re" +#line 230 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_FAIL); goto opt; } -#line 3062 "src/conf/parse_opts.cc" +#line 3066 "src/conf/parse_opts.cc" yy743: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy745; @@ -3077,9 +3081,9 @@ yy746: goto yy732; yy747: ++YYCURSOR; -#line 224 "../src/conf/parse_opts.re" +#line 228 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_IGNORE); goto opt; } -#line 3083 "src/conf/parse_opts.cc" +#line 3087 "src/conf/parse_opts.cc" yy749: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'u') goto yy732; @@ -3090,11 +3094,11 @@ yy749: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy732; ++YYCURSOR; -#line 225 "../src/conf/parse_opts.re" +#line 229 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_SUBSTITUTE); goto opt; } -#line 3096 "src/conf/parse_opts.cc" +#line 3100 "src/conf/parse_opts.cc" } -#line 227 "../src/conf/parse_opts.re" +#line 231 "../src/conf/parse_opts.re" opt_input: @@ -3104,7 +3108,7 @@ opt_input: return EXIT_FAIL; } -#line 3108 "src/conf/parse_opts.cc" +#line 3112 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -3114,12 +3118,12 @@ opt_input: yy757: ++YYCURSOR; yy758: -#line 237 "../src/conf/parse_opts.re" +#line 241 "../src/conf/parse_opts.re" { error ("bad argument to option --input (expected: default | custom): %s", *argv); return EXIT_FAIL; } -#line 3123 "src/conf/parse_opts.cc" +#line 3127 "src/conf/parse_opts.cc" yy759: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'u') goto yy761; @@ -3172,18 +3176,18 @@ yy771: goto yy762; yy772: ++YYCURSOR; -#line 242 "../src/conf/parse_opts.re" +#line 246 "../src/conf/parse_opts.re" { opts.set_input_api(INPUT_CUSTOM); goto opt; } -#line 3178 "src/conf/parse_opts.cc" +#line 3182 "src/conf/parse_opts.cc" yy774: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy762; ++YYCURSOR; -#line 241 "../src/conf/parse_opts.re" +#line 245 "../src/conf/parse_opts.re" { opts.set_input_api(INPUT_DEFAULT); goto opt; } -#line 3185 "src/conf/parse_opts.cc" +#line 3189 "src/conf/parse_opts.cc" } -#line 243 "../src/conf/parse_opts.re" +#line 247 "../src/conf/parse_opts.re" opt_empty_class: @@ -3193,7 +3197,7 @@ opt_empty_class: return EXIT_FAIL; } -#line 3197 "src/conf/parse_opts.cc" +#line 3201 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -3201,12 +3205,12 @@ opt_empty_class: if (yych == 'm') goto yy782; ++YYCURSOR; yy780: -#line 253 "../src/conf/parse_opts.re" +#line 257 "../src/conf/parse_opts.re" { error ("bad argument to option --empty-class (expected: match-empty | match-none | error): %s", *argv); return EXIT_FAIL; } -#line 3210 "src/conf/parse_opts.cc" +#line 3214 "src/conf/parse_opts.cc" yy781: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'r') goto yy783; @@ -3251,9 +3255,9 @@ yy791: goto yy784; yy792: ++YYCURSOR; -#line 259 "../src/conf/parse_opts.re" +#line 263 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_ERROR); goto opt; } -#line 3257 "src/conf/parse_opts.cc" +#line 3261 "src/conf/parse_opts.cc" yy794: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy795; @@ -3297,16 +3301,16 @@ yy803: goto yy784; yy804: ++YYCURSOR; -#line 258 "../src/conf/parse_opts.re" +#line 262 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_NONE); goto opt; } -#line 3303 "src/conf/parse_opts.cc" +#line 3307 "src/conf/parse_opts.cc" yy806: ++YYCURSOR; -#line 257 "../src/conf/parse_opts.re" +#line 261 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_EMPTY); goto opt; } -#line 3308 "src/conf/parse_opts.cc" +#line 3312 "src/conf/parse_opts.cc" } -#line 260 "../src/conf/parse_opts.re" +#line 264 "../src/conf/parse_opts.re" opt_dfa_minimization: @@ -3316,7 +3320,7 @@ opt_dfa_minimization: return EXIT_FAIL; } -#line 3320 "src/conf/parse_opts.cc" +#line 3324 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -3324,12 +3328,12 @@ opt_dfa_minimization: if (yych == 't') goto yy813; ++YYCURSOR; yy811: -#line 270 "../src/conf/parse_opts.re" +#line 274 "../src/conf/parse_opts.re" { error ("bad argument to option --dfa-minimization (expected: table | moore): %s", *argv); return EXIT_FAIL; } -#line 3333 "src/conf/parse_opts.cc" +#line 3337 "src/conf/parse_opts.cc" yy812: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'o') goto yy814; @@ -3374,16 +3378,16 @@ yy822: goto yy815; yy823: ++YYCURSOR; -#line 275 "../src/conf/parse_opts.re" +#line 279 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_MOORE); goto opt; } -#line 3380 "src/conf/parse_opts.cc" +#line 3384 "src/conf/parse_opts.cc" yy825: ++YYCURSOR; -#line 274 "../src/conf/parse_opts.re" +#line 278 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_TABLE); goto opt; } -#line 3385 "src/conf/parse_opts.cc" +#line 3389 "src/conf/parse_opts.cc" } -#line 276 "../src/conf/parse_opts.re" +#line 280 "../src/conf/parse_opts.re" end: diff --git a/re2c/src/conf/parse_opts.re b/re2c/src/conf/parse_opts.re index c8d1b31f..ff3e85fd 100644 --- a/re2c/src/conf/parse_opts.re +++ b/re2c/src/conf/parse_opts.re @@ -16,8 +16,7 @@ static inline bool next (char * & arg, char ** & argv) parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Warn &warn) { #define YYCTYPE unsigned char - char * YYCURSOR; - char * YYMARKER; + char *YYCURSOR, *YYMARKER, *p; Warn::option_t option; /*!re2c @@ -106,7 +105,7 @@ opt_short: "S" { globopts.target = TARGET_SKELETON; goto opt_short; } "I" end { if (!next (YYCURSOR, argv)) { error_arg ("-I"); return EXIT_FAIL; } goto opt_incpath; } - "I" { goto opt_incpath; } + "I" { goto opt_incpath; } "b" { opts.set_bFlag(true); goto opt_short; } "d" { opts.set_dFlag(true); goto opt_short; } @@ -201,12 +200,17 @@ opt_header: */ opt_incpath: + p = YYCURSOR; /*!re2c * { error ("bad argument to option -I: %s", *argv); return EXIT_FAIL; } - filename end { globopts.incpaths.push_back(*argv); goto opt; } + filename end { + std::string name(p, static_cast(YYCURSOR - p - 1)); + globopts.incpaths.push_back(name); + goto opt; + } */ opt_encoding_policy: -- 2.40.0