From ea77eabc7bfff76ddb892d4ff27e89227dcf97c1 Mon Sep 17 00:00:00 2001 From: gibbs Date: Tue, 16 Dec 2003 23:54:07 +0000 Subject: Modify assembler to ignore carriage returns in input. This should make those using the assembler under cygwin happy. --- sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l | 3 ++- sys/dev/aic7xxx/aicasm/aicasm_scan.l | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'sys/dev/aic7xxx') diff --git a/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l b/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l index d781443..f06e703 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l +++ b/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l @@ -38,7 +38,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_macro_scan.l#7 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_macro_scan.l#8 $ * * $FreeBSD$ */ @@ -78,6 +78,7 @@ MCARG [^(), \t]+ \n { ++yylineno; } +\r ; {SPACE} ; \( { parren_count++; diff --git a/sys/dev/aic7xxx/aicasm/aicasm_scan.l b/sys/dev/aic7xxx/aicasm/aicasm_scan.l index e4dc6fd..45c0b23 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_scan.l +++ b/sys/dev/aic7xxx/aicasm/aicasm_scan.l @@ -38,7 +38,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#18 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#19 $ * * $FreeBSD$ */ @@ -87,6 +87,7 @@ MBODY ((\\[^\n])*[^\n\\]*)+ %% \n { ++yylineno; } +\r ; "/*" { BEGIN COMMENT; /* Enter comment eating state */ } "/*" { fprintf(stderr, "Warning! Comment within comment."); } \n { ++yylineno; } @@ -114,6 +115,7 @@ if[ \t]*\( { } } \n { ++yylineno; } +\r ; [^()\n]+ { char *yptr; @@ -359,6 +361,7 @@ else { return T_ELSE; } /* Eat escaped newlines. */ ++yylineno; } +\r ; \n { /* Macros end on the first unescaped newline. */ BEGIN INITIAL; @@ -369,10 +372,17 @@ else { return T_ELSE; } } {MBODY} { char *yptr; + char c; yptr = yytext; - while (*yptr) - *string_buf_ptr++ = *yptr++; + while (c = *yptr++) { + /* + * Strip carriage returns. + */ + if (c == '\r') + continue; + *string_buf_ptr++ = c; + } } {WORD}\( { char *yptr; -- cgit v1.1