Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
#line 1 "test.rl" #include <stdio.h> #include <stdlib.h> #line 31 "test.rl" #define BUFSIZE 100 #line 12 "test.c" static const int test_start = 1; static const int test_first_final = 5; static const int test_error = 0; static const int test_en_main = 1; #line 36 "test.rl" int main() { char buf[BUFSIZE]; char *p; int cs; while (fgets(buf, sizeof(buf), stdin) != 0) { p = buf; #line 29 "test.c" { cs = test_start; } #line 34 "test.c" { switch ( cs ) { tr3: #line 7 "test.rl" { printf("%c\n", *(&(*p)-1)); } goto st1; tr5: #line 8 "test.rl" { printf("%c%c\n", *(&(*p)-2), *(&(*p)-1)); } goto st1; st1: p += 1; case 1: #line 49 "test.c" if ( (*p) == 52 ) goto st4; if ( 48 <= (*p) && (*p) <= 57 ) goto st2; goto st0; st0: cs = 0; goto _out; st2: p += 1; case 2: if ( (*p) == 10 ) goto tr3; if ( 48 <= (*p) && (*p) <= 57 ) goto st3; goto st0; st3: p += 1; case 3: if ( (*p) == 10 ) goto tr5; goto st0; st4: p += 1; case 4: switch( (*p) ) { case 10: goto tr3; case 50: goto tr6; } if ( 48 <= (*p) && (*p) <= 57 ) goto st3; goto st0; tr6: #line 9 "test.rl" { exit(0); } goto st5; st5: p += 1; case 5: #line 89 "test.c" goto st0; } _out: {} } #line 47 "test.rl" } return 0; }
This paste will be private.
From the Design Piracy series on my blog: