X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fparser%2Fhslexer.flex;fp=ghc%2Fcompiler%2Fparser%2Fhslexer.flex;h=f7da732a6aa9f16b2398ec3deaa7641a50619bf6;hb=1fb1ab5d53a09607e7f6d2450806760688396387;hp=efac20b4a8b95738b7f3af111e981e5109fb2795;hpb=fa6fb09e2e4e6918eebc79ed187f32c88817c9db;p=ghc-hetmet.git diff --git a/ghc/compiler/parser/hslexer.flex b/ghc/compiler/parser/hslexer.flex index efac20b..f7da732 100644 --- a/ghc/compiler/parser/hslexer.flex +++ b/ghc/compiler/parser/hslexer.flex @@ -307,8 +307,18 @@ NL [\n\r] nested_comments =1; PUSH_STATE(Comment); } +"{-#"{WS}*"OPTIONS" { + /* these are by the driver! */ + nested_comments =1; + PUSH_STATE(Comment); + } +"{-#"{WS}*"SOURCE" { + /* these are used by `make depend' (temp) */ + nested_comments =1; + PUSH_STATE(Comment); + } "{-#"{WS}*[A-Z_]+ { - fprintf(stderr, "\"%s\", line %d: Warning: Unrecognised pragma '", + fprintf(stderr, "%s:%d: Warning: Unrecognised pragma '", input_filename, hsplineno); format_string(stderr, (unsigned char *) yytext, yyleng); fputs("'\n", stderr); @@ -381,6 +391,7 @@ NL [\n\r] "<-" { RETURN(LARROW); } "->" { RETURN(RARROW); } "-" { RETURN(MINUS); } +"+" { RETURN(PLUS); } "=>" { RETURN(DARROW); } "@" { RETURN(AT); } @@ -558,7 +569,7 @@ NL [\n\r] } if (length > 1) { - fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '", + fprintf(stderr, "%s:%d:%d: Unboxed character literal '", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) text, length); fputs("' too long\n", stderr); @@ -577,7 +588,7 @@ NL [\n\r] text = fetchtext(&length); if (length > 1) { - fprintf(stderr, "\"%s\", line %d, column %d: Character literal '", + fprintf(stderr, "%s:%d:%d: Character literal '", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) text, length); fputs("' too long\n", stderr); @@ -799,21 +810,21 @@ NL [\n\r] %} (.|\n) { - fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `", + fprintf(stderr, "%s:%d:%d: Illegal character: `", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) yytext, 1); fputs("'\n", stderr); hsperror(""); } (.|\n) { - fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `", + fprintf(stderr, "%s:%d:%d: Illegal character: `", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) yytext, 1); fputs("' in a character literal\n", stderr); hsperror(""); } (.|\n) { - fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\", + fprintf(stderr, "%s:%d:%d: Illegal character escape: `\\", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) yytext, 1); fputs("'\n", stderr); @@ -822,7 +833,7 @@ NL [\n\r] (.|\n) { if (nonstandardFlag) { addtext(yytext, yyleng); } else { - fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `", + fprintf(stderr, "%s:%d:%d: Illegal character: `", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) yytext, 1); fputs("' in a string literal\n", stderr); @@ -831,13 +842,13 @@ NL [\n\r] } (.|\n) { if (noGap) { - fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\", + fprintf(stderr, "%s:%d:%d: Illegal string escape: `\\", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) yytext, 1); fputs("'\n", stderr); hsperror(""); } else { - fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `", + fprintf(stderr, "%s:%d:%d: Illegal character: `", input_filename, hsplineno, hspcolno + 1); format_string(stderr, (unsigned char *) yytext, 1); fputs("' in a string gap\n", stderr);