]> granicus.if.org Git - re2c/commitdiff
Omit some useless newlines in the generated code.
authorUlya Trofimovich <skvadrik@gmail.com>
Sun, 3 Apr 2016 07:31:25 +0000 (08:31 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sun, 3 Apr 2016 07:31:25 +0000 (08:31 +0100)
25 files changed:
re2c/bootstrap/src/parse/lex.cc
re2c/src/parse/lex.re
re2c/test/condition_06.cs.c
re2c/test/condition_07.cbi.c
re2c/test/condition_08.cbi.c
re2c/test/condition_08.cbif.c
re2c/test/condition_09.cbif.c
re2c/test/condition_09.cgif.c
re2c/test/condition_10.cgif.c
re2c/test/condition_12.cgif.c
re2c/test/condition_14.cbif.c
re2c/test/condition_14.cgif.c
re2c/test/condition_14.cif.c
re2c/test/condition_14.csif.c
re2c/test/condition_15.csif.c
re2c/test/condtype_decl.c.c
re2c/test/condtype_decl.cg.c
re2c/test/condtype_decl.cs.c
re2c/test/condtype_forwdecl.cg.c
re2c/test/condtype_forwdecl.cs.c
re2c/test/repeat-01.cgir.c
re2c/test/repeat-02.cgir.c
re2c/test/repeat-03.cgir.c
re2c/test/reuse_conds_default_1.cgir.c
re2c/test/yyaccept_missing.bci.c

index 2f2006e13a57803140f18bca58d4f1fc7edcfd46..ff7ff99f591ffa89c2f09202e4325f9c28884f20 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.16 on Sat Apr  2 22:03:43 2016 */
+/* Generated by re2c 0.16 on Sun Apr  3 08:30:42 2016 */
 #line 1 "../src/parse/lex.re"
 #include "src/util/c99_stdint.h"
 #include <stddef.h>
@@ -612,8 +612,8 @@ yy107:
        {
                if (opts->target == opt_t::CODE) {
                        out.wraw(tok, start)
-                               .wdelay_line_info().ws("\n")
-                               .wdelay_types().ws("\n")
+                               .wdelay_line_info()
+                               .wdelay_types()
                                .wline_info(cline, get_fname().c_str());
                }
                lex_end_of_comment();
index 2ce931a084451516ab9acf424deea261db1ae700..006c0b5a094d784eee91be5dad82a28ce76971e7 100644 (file)
@@ -134,8 +134,8 @@ echo:
        "/*!types:re2c" {
                if (opts->target == opt_t::CODE) {
                        out.wraw(tok, start)
-                               .wdelay_line_info().ws("\n")
-                               .wdelay_types().ws("\n")
+                               .wdelay_line_info()
+                               .wdelay_types()
                                .wline_info(cline, get_fname().c_str());
                }
                lex_end_of_comment();
index 7a2096e1060c64e67b9f29a18d55a02d07d10f7f..c90abde6cc07255606caac495076e5c24ba00beb 100644 (file)
@@ -54,14 +54,12 @@ void fputl(const char *s, size_t len, FILE *stream)
 }
 
 #line 57 "condition_06.cs.c"
-
 enum YYCONDTYPE {
        EStateNormal,
        EStateComment,
        EStateSkiptoeol,
        EStateString,
 };
-
 #line 54 "condition_06.cs.re"
 
 
@@ -75,7 +73,7 @@ void scan(Scanner *s)
        {
                s->tok = s->cur;
 
-#line 79 "condition_06.cs.c"
+#line 77 "condition_06.cs.c"
                {
                        unsigned char yych;
                        if (cond < 2) {
@@ -102,7 +100,7 @@ yy4:
                        {
                                goto yyc_Comment;
                        }
-#line 106 "condition_06.cs.c"
+#line 104 "condition_06.cs.c"
 yy5:
                        yych = *++s->cur;
                        if (yych != '/') goto yy4;
@@ -111,7 +109,7 @@ yy5:
                        {
                                continue;
                        }
-#line 115 "condition_06.cs.c"
+#line 113 "condition_06.cs.c"
 /* *********************************** */
 yyc_Normal:
                        if ((s->lim - s->cur) < 3) { if(fill(s, 3) >= 0) break; }
@@ -129,7 +127,7 @@ yy11:
                                fputc(*s->tok, stdout);
                                continue;
                        }
-#line 133 "condition_06.cs.c"
+#line 131 "condition_06.cs.c"
 yy12:
                        ++s->cur;
 #line 134 "condition_06.cs.re"
@@ -138,7 +136,7 @@ yy12:
                                state = EStateString;
                                continue;
                        }
-#line 142 "condition_06.cs.c"
+#line 140 "condition_06.cs.c"
 yy14:
                        yych = *++s->cur;
                        if (yych == '*') goto yy16;
@@ -154,14 +152,14 @@ yy16:
                        {
                                goto yyc_Comment;
                        }
-#line 158 "condition_06.cs.c"
+#line 156 "condition_06.cs.c"
 yy18:
                        ++s->cur;
 #line 130 "condition_06.cs.re"
                        {
                                goto yyc_Skiptoeol;
                        }
-#line 165 "condition_06.cs.c"
+#line 163 "condition_06.cs.c"
 yy20:
                        yych = *++s->cur;
                        switch (yych) {
@@ -186,7 +184,7 @@ yy22:
                                fputc('|', stdout);
                                continue;
                        }
-#line 190 "condition_06.cs.c"
+#line 188 "condition_06.cs.c"
 yy24:
                        ++s->cur;
 #line 111 "condition_06.cs.re"
@@ -194,7 +192,7 @@ yy24:
                                fputc('^', stdout);
                                continue;
                        }
-#line 198 "condition_06.cs.c"
+#line 196 "condition_06.cs.c"
 yy26:
                        ++s->cur;
 #line 81 "condition_06.cs.re"
@@ -202,7 +200,7 @@ yy26:
                                fputc('[', stdout);
                                continue;
                        }
-#line 206 "condition_06.cs.c"
+#line 204 "condition_06.cs.c"
 yy28:
                        ++s->cur;
 #line 86 "condition_06.cs.re"
@@ -210,7 +208,7 @@ yy28:
                                fputc(']', stdout);
                                continue;
                        }
-#line 214 "condition_06.cs.c"
+#line 212 "condition_06.cs.c"
 yy30:
                        ++s->cur;
 #line 121 "condition_06.cs.re"
@@ -218,7 +216,7 @@ yy30:
                                fputc('~', stdout);
                                continue;
                        }
-#line 222 "condition_06.cs.c"
+#line 220 "condition_06.cs.c"
 yy32:
                        ++s->cur;
 #line 106 "condition_06.cs.re"
@@ -226,7 +224,7 @@ yy32:
                                fputc('\\', stdout);
                                continue;
                        }
-#line 230 "condition_06.cs.c"
+#line 228 "condition_06.cs.c"
 yy34:
                        ++s->cur;
 #line 91 "condition_06.cs.re"
@@ -234,7 +232,7 @@ yy34:
                                fputc('{', stdout);
                                continue;
                        }
-#line 238 "condition_06.cs.c"
+#line 236 "condition_06.cs.c"
 yy36:
                        ++s->cur;
 #line 101 "condition_06.cs.re"
@@ -242,7 +240,7 @@ yy36:
                                fputc('#', stdout);
                                continue;
                        }
-#line 246 "condition_06.cs.c"
+#line 244 "condition_06.cs.c"
 yy38:
                        ++s->cur;
 #line 96 "condition_06.cs.re"
@@ -250,7 +248,7 @@ yy38:
                                fputc('}', stdout);
                                continue;
                        }
-#line 254 "condition_06.cs.c"
+#line 252 "condition_06.cs.c"
 /* *********************************** */
 yyc_Skiptoeol:
                        if ((s->lim - s->cur) < 5) { if(fill(s, 5) >= 0) break; }
@@ -267,14 +265,14 @@ yy43:
                        {
                                goto yyc_Skiptoeol;
                        }
-#line 271 "condition_06.cs.c"
+#line 269 "condition_06.cs.c"
 yy44:
                        ++s->cur;
 #line 161 "condition_06.cs.re"
                        {
                                continue;
                        }
-#line 278 "condition_06.cs.c"
+#line 276 "condition_06.cs.c"
 yy46:
                        yych = *(s->tok = ++s->cur);
                        if (yych == '?') goto yy48;
@@ -296,7 +294,7 @@ yy50:
                        {
                                goto yyc_Skiptoeol;
                        }
-#line 300 "condition_06.cs.c"
+#line 298 "condition_06.cs.c"
 yy52:
                        yych = *++s->cur;
                        if (yych == '\n') goto yy50;
@@ -312,7 +310,7 @@ yy54:
                        {
                                goto yyc_Skiptoeol;
                        }
-#line 316 "condition_06.cs.c"
+#line 314 "condition_06.cs.c"
 yy56:
                        ++s->cur;
                        if ((yych = *s->cur) == '\n') goto yy54;
@@ -330,7 +328,7 @@ yy60:
                                fputc(*s->tok, stdout);
                                continue;
                        }
-#line 334 "condition_06.cs.c"
+#line 332 "condition_06.cs.c"
 yy61:
                        ++s->cur;
 #line 174 "condition_06.cs.re"
@@ -338,7 +336,7 @@ yy61:
                                fputc(*s->tok, stdout);
                                continue;
                        }
-#line 342 "condition_06.cs.c"
+#line 340 "condition_06.cs.c"
 yy63:
                        yych = *++s->cur;
                        if (yych == '\n') goto yy60;
@@ -348,7 +346,7 @@ yy63:
                                fputl((const char*)s->tok, 2, stdout);
                                continue;
                        }
-#line 352 "condition_06.cs.c"
+#line 350 "condition_06.cs.c"
                }
 #line 183 "condition_06.cs.re"
 
index ada83c2a7ec07fa6940ac475b56de7e9fef7e877..283b56f2b950fe678b113a2cd1867cb6ee7e2289 100644 (file)
@@ -52,14 +52,12 @@ void fputl(const char *s, size_t len, FILE *stream)
        }
 }
 
-
 enum YYCONDTYPE {
        EStateR1,
        EStateR2,
 };
 
 
-
 void scan(Scanner *s)
 {
        int cond = EStateR1;
index f4265f86f9c51b72220ed6bce42e993f853ee067..ec6a446980f91d32d757ce16a0841c99a1722058 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 6c8aa6f9c9ffd4a1cf255b7be2b4c9f1e9e553cf..017009b68d1c3fbcf6f26165223e2b694aed2381 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index eb4ee4d37a76a5dbc71a9b4bbfb9ed925006deb5..ceafc6a8896df69213d791872b44c0f761ce8289 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 731afa5cb52af49073c46fd347c2d43b4e39114d..a312343c6697ddef87e4b0eef990828f3b308730 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 1d92fbe29224a4c2ebb615e4420b4eb042d5db7d..42a78b4587750870f6e5f8a89961a8e43b0b0dd0 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 058f0b2496ff55693db40f67075f2ff3683a8e71..64158b251bcdf3aaea32ace47ea6f89dae731da5 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 4cd54ddaee99cf88c88ef84ce5eb5bdc6b7bfcde..cc49f47daae58c9264648583fde60d4826860e29 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 10aaab1026455fbf843706bc18b9c2b4f14efde8..bb5b33fe17b4f093f9f6ba15e7fb294c792828cb 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 64b5024bc5447784d0cd7efd7cb1534ec7055039..d2e7c8d9c1cfacee4d730cd69fdc765a8f4c1cce 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index 4cd54ddaee99cf88c88ef84ce5eb5bdc6b7bfcde..cc49f47daae58c9264648583fde60d4826860e29 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index ea6e13c07b63f09cca3cec2b24c470b2b9e8ba19..7002913fce2c4dea872c499f7dd1a9fc5380c48f 100644 (file)
@@ -5,7 +5,6 @@
 
 #define        BSIZE   8192
 
-
 enum ScanContition {
        EStateNormal,
        EStateComment,
@@ -14,7 +13,6 @@ enum ScanContition {
 };
 
 
-
 typedef struct Scanner
 {
        FILE                        *fp;
index a198c542c053ac4f53e24b7f9ff0ca2334d285ce..a6fd66d1e04e37064985c53a2f8ab3c279865e97 100644 (file)
@@ -1,12 +1,10 @@
 /* Generated by re2c */
 #line 1 "condtype_decl.c.re"
 #line 4 "condtype_decl.c.c"
-
 enum YYCONDTYPE {
        yyca,
        yycb,
 };
-
 #line 1 "condtype_decl.c.re"
 
 
@@ -16,7 +14,7 @@ int main ()
        char * YYCURSOR;
 #define YYGETCONDITION() cond
 
-#line 20 "condtype_decl.c.c"
+#line 18 "condtype_decl.c.c"
 {
        unsigned char yych;
        switch (YYGETCONDITION()) {
@@ -35,7 +33,7 @@ yy4:
        ++YYCURSOR;
 #line 11 "condtype_decl.c.re"
        {}
-#line 39 "condtype_decl.c.c"
+#line 37 "condtype_decl.c.c"
 /* *********************************** */
 yyc_b:
        yych = *YYCURSOR;
@@ -48,7 +46,7 @@ yy9:
        ++YYCURSOR;
 #line 12 "condtype_decl.c.re"
        {}
-#line 52 "condtype_decl.c.c"
+#line 50 "condtype_decl.c.c"
 }
 #line 13 "condtype_decl.c.re"
 
index 82d5a5219717095ca981783c95551d70cd3a4e94..58634842d43acc0112712321ea3d5c69008419f7 100644 (file)
@@ -1,12 +1,10 @@
 /* Generated by re2c */
 #line 1 "condtype_decl.cg.re"
 #line 4 "condtype_decl.cg.c"
-
 enum YYCONDTYPE {
        yyca,
        yycb,
 };
-
 #line 1 "condtype_decl.cg.re"
 
 
@@ -16,7 +14,7 @@ int main ()
        char * YYCURSOR;
 #define YYGETCONDITION() cond
 
-#line 20 "condtype_decl.cg.c"
+#line 18 "condtype_decl.cg.c"
 {
        unsigned char yych;
        static void *yyctable[2] = {
@@ -32,7 +30,7 @@ yy4:
        ++YYCURSOR;
 #line 11 "condtype_decl.cg.re"
        {}
-#line 36 "condtype_decl.cg.c"
+#line 34 "condtype_decl.cg.c"
 /* *********************************** */
 yyc_b:
        yych = *YYCURSOR;
@@ -41,7 +39,7 @@ yy9:
        ++YYCURSOR;
 #line 12 "condtype_decl.cg.re"
        {}
-#line 45 "condtype_decl.cg.c"
+#line 43 "condtype_decl.cg.c"
 }
 #line 13 "condtype_decl.cg.re"
 
index 0ec9e9b9bd721712024647f9286e9764cea07c02..14b187383e34f3877d4975e5d5a453d3be381782 100644 (file)
@@ -1,12 +1,10 @@
 /* Generated by re2c */
 #line 1 "condtype_decl.cs.re"
 #line 4 "condtype_decl.cs.c"
-
 enum YYCONDTYPE {
        yyca,
        yycb,
 };
-
 #line 1 "condtype_decl.cs.re"
 
 
@@ -16,7 +14,7 @@ int main ()
        char * YYCURSOR;
 #define YYGETCONDITION() cond
 
-#line 20 "condtype_decl.cs.c"
+#line 18 "condtype_decl.cs.c"
 {
        unsigned char yych;
        if (YYGETCONDITION() < 1) {
@@ -32,7 +30,7 @@ yy4:
        ++YYCURSOR;
 #line 11 "condtype_decl.cs.re"
        {}
-#line 36 "condtype_decl.cs.c"
+#line 34 "condtype_decl.cs.c"
 /* *********************************** */
 yyc_b:
        yych = *YYCURSOR;
@@ -41,7 +39,7 @@ yy9:
        ++YYCURSOR;
 #line 12 "condtype_decl.cs.re"
        {}
-#line 45 "condtype_decl.cs.c"
+#line 43 "condtype_decl.cs.c"
 }
 #line 13 "condtype_decl.cs.re"
 
index 5253dd4e354d0ac9733a42eeb9405a4d8c800f65..ae1f36bdbc71cc18a6fee5442d3f6f96c1ddd18c 100644 (file)
@@ -41,12 +41,10 @@ yy9:
 }
 
 #line 44 "condtype_forwdecl.cg.c"
-
 enum cond_t : int {
        yyca,
        yycb,
 };
-
 #line 18 "condtype_forwdecl.cg.re"
 
 re2c: warning: line 14: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow]
index 6419423c93b77312ca27db4283deef61a61cdfe9..b408b86974f941a6d2d632e2c8b0d757637e1cd3 100644 (file)
@@ -41,12 +41,10 @@ yy9:
 }
 
 #line 44 "condtype_forwdecl.cs.c"
-
 enum cond_t : int {
        yyca,
        yycb,
 };
-
 #line 18 "condtype_forwdecl.cs.re"
 
 re2c: warning: line 14: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow]
index f23bac4b15d9bb55984daa64592037903c481bbc..1a8090017695375f0acdc299ba3eea63d7f481ef 100644 (file)
@@ -1,14 +1,12 @@
 /* Generated by re2c */
 // multiple scanners
 
-
 enum YYCONDTYPE {
        yycr1,
        yycr2,
 };
 
 
-
 void scan(unsigned char* in)
 {
 
index d6fc40eee86b03dd5a1142f500005b06703bb515..62379b0d7e2437ebbb2ad8a203e080eeec6e6f07 100644 (file)
@@ -1,14 +1,12 @@
 /* Generated by re2c */
 // multiple scanners
 
-
 enum YYCONDTYPE {
        yycr1,
        yycr2,
 };
 
 
-
 void scan(unsigned char* in)
 {
 
index 78f176b12c1a59d8849176c4bbc7ddaa67897159..15730381520c909ec5ea14db447bdcb95b6b95de 100644 (file)
@@ -1,14 +1,12 @@
 /* Generated by re2c */
 // multiple scanners
 
-
 enum YYCONDTYPE {
        yycr1,
        yycr2,
 };
 
 
-
 void scan(unsigned char* in)
 {
 
index fcf8302fbc515ba5f82fb373b74f2a493a70e2a3..500f734bcb79564755172a22dd776803ef3c1602 100644 (file)
@@ -3,13 +3,11 @@
 // 're2c: error: line 11, column 9: code to default rule 'r1' is already defined'
 // This must be fixed later
 
-
 enum YYCONDTYPE {
        yycr2,
 };
 
 
-
 void scan(unsigned char* in)
 {
 
index 46ccebe2615825d0e4fc19e4c5a5bdebb2e3b91c..fe4aa2997ce43490fc57775558d6ea247283da62 100644 (file)
 
 static enum YYCONDTYPE yy_state;
 
-
 enum YYCONDTYPE {
        yycINITIAL,
        yycST_VALUE,
 };
 
 
-
 int scan(char *s, int l)
 {
        char *p = s;