From f340bd2bb7b9872948aab33124814a67093f0368 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 4 Jun 2016 02:23:38 -0400 Subject: handle splitting of the \e(B between the ( and the B --- src/parser.c | 47 +++++++++++++++++++++++------------------------ src/parser.h | 2 +- src/parser.l | 9 ++++----- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/parser.c b/src/parser.c index cef8907..da30554 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1236,41 +1236,42 @@ case 43: case 44: YY_RULE_SETUP #line 184 "src/parser.l" -/* ignored */ +/* ignored - not interested in implementing character sets, unicode + should be sufficient */ YY_BREAK case 45: YY_RULE_SETUP -#line 186 "src/parser.l" +#line 187 "src/parser.l" vt100_parser_handle_ascii(yyextra, yytext, yyleng); YY_BREAK case 46: YY_RULE_SETUP -#line 187 "src/parser.l" +#line 188 "src/parser.l" vt100_parser_handle_text(yyextra, yytext, yyleng); YY_BREAK case 47: -#line 190 "src/parser.l" -case 48: #line 191 "src/parser.l" -case 49: +case 48: #line 192 "src/parser.l" -case 50: +case 49: #line 193 "src/parser.l" -case 51: +case 50: #line 194 "src/parser.l" +case 51: +#line 195 "src/parser.l" case 52: YY_RULE_SETUP -#line 194 "src/parser.l" +#line 195 "src/parser.l" return yyleng; YY_BREAK case YY_STATE_EOF(INITIAL): -#line 196 "src/parser.l" +#line 197 "src/parser.l" return 0; YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP -#line 198 "src/parser.l" +#line 199 "src/parser.l" { fprintf(stderr, "unhandled CSI sequence: \\033%s\\%03hho\n", @@ -1279,14 +1280,14 @@ YY_RULE_SETUP YY_BREAK case 54: YY_RULE_SETUP -#line 204 "src/parser.l" +#line 205 "src/parser.l" { fprintf(stderr, "unhandled CSI sequence: \\033%s\n", yytext + 1); } YY_BREAK case 55: YY_RULE_SETUP -#line 208 "src/parser.l" +#line 209 "src/parser.l" { if (!strncmp(yytext, "\e]50;", 5)) { // osx terminal.app private stuff // not interested in non-portable extensions @@ -1305,20 +1306,18 @@ YY_RULE_SETUP case 56: /* rule 56 can match eol */ YY_RULE_SETUP -#line 223 "src/parser.l" +#line 224 "src/parser.l" { fprintf(stderr, "unhandled escape sequence: \\%03hho\n", yytext[1]); } YY_BREAK case 57: YY_RULE_SETUP -#line 227 "src/parser.l" +#line 228 "src/parser.l" { switch (yytext[1]) { - case '(': // character sets - // not interested in implementing character sets, unicode should be - // sufficient - break; + case '(': // character sets - there should be some trailing bytes + return yyleng; default: fprintf(stderr, "unhandled escape sequence: %s\n", yytext + 1); break; @@ -1328,24 +1327,24 @@ YY_RULE_SETUP case 58: /* rule 58 can match eol */ YY_RULE_SETUP -#line 239 "src/parser.l" +#line 238 "src/parser.l" { fprintf(stderr, "unhandled control character: \\%03hho\n", yytext[0]); } YY_BREAK case 59: YY_RULE_SETUP -#line 243 "src/parser.l" +#line 242 "src/parser.l" { fprintf(stderr, "invalid utf8 byte: \\%03hho\n", yytext[0]); } YY_BREAK case 60: YY_RULE_SETUP -#line 247 "src/parser.l" +#line 246 "src/parser.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1349 "src/parser.c" +#line 1348 "src/parser.c" case YY_END_OF_BUFFER: { @@ -2446,7 +2445,7 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 247 "src/parser.l" +#line 246 "src/parser.l" diff --git a/src/parser.h b/src/parser.h index 83321e9..f13a050 100644 --- a/src/parser.h +++ b/src/parser.h @@ -343,7 +343,7 @@ extern int vt100_parser_yylex (yyscan_t yyscanner); #undef YY_DECL #endif -#line 247 "src/parser.l" +#line 246 "src/parser.l" #line 350 "src/parser.h" diff --git a/src/parser.l b/src/parser.l index ecfe812..34abf4a 100644 --- a/src/parser.l +++ b/src/parser.l @@ -181,7 +181,8 @@ static void vt100_parser_handle_text(VT100Screen *vt, char *text, size_t len); {GZD4} | {G1D4} | {G2D4} | -{G3D4} /* ignored */ +{G3D4} /* ignored - not interested in implementing character sets, unicode + should be sufficient */ {ASCII}+ vt100_parser_handle_ascii(yyextra, yytext, yyleng); {CHAR}+ vt100_parser_handle_text(yyextra, yytext, yyleng); @@ -226,10 +227,8 @@ static void vt100_parser_handle_text(VT100Screen *vt, char *text, size_t len); {ESC}{CHAR} { switch (yytext[1]) { - case '(': // character sets - // not interested in implementing character sets, unicode should be - // sufficient - break; + case '(': // character sets - there should be some trailing bytes + return yyleng; default: fprintf(stderr, "unhandled escape sequence: %s\n", yytext + 1); break; -- cgit v1.2.3