summaryrefslogtreecommitdiffstats
path: root/sys/dev/aic7xxx
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2003-12-16 23:54:07 +0000
committergibbs <gibbs@FreeBSD.org>2003-12-16 23:54:07 +0000
commitea77eabc7bfff76ddb892d4ff27e89227dcf97c1 (patch)
treef97c2c9d07607d7f5ef6973500aaed4f3806598b /sys/dev/aic7xxx
parent40e8e94c688a97fddabe53f3b5abb5ef5bfabe3c (diff)
downloadFreeBSD-src-ea77eabc7bfff76ddb892d4ff27e89227dcf97c1.zip
FreeBSD-src-ea77eabc7bfff76ddb892d4ff27e89227dcf97c1.tar.gz
Modify assembler to ignore carriage returns in input.
This should make those using the assembler under cygwin happy.
Diffstat (limited to 'sys/dev/aic7xxx')
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l3
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_scan.l16
2 files changed, 15 insertions, 4 deletions
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 ;
<ARGLIST>{SPACE} ;
<ARGLIST>\( {
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 */ }
<COMMENT>"/*" { fprintf(stderr, "Warning! Comment within comment."); }
<COMMENT>\n { ++yylineno; }
@@ -114,6 +115,7 @@ if[ \t]*\( {
}
}
<CEXPR>\n { ++yylineno; }
+<CEXPR>\r ;
<CEXPR>[^()\n]+ {
char *yptr;
@@ -359,6 +361,7 @@ else { return T_ELSE; }
/* Eat escaped newlines. */
++yylineno;
}
+<MACROBODY>\r ;
<MACROBODY>\n {
/* Macros end on the first unescaped newline. */
BEGIN INITIAL;
@@ -369,10 +372,17 @@ else { return T_ELSE; }
}
<MACROBODY>{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;
OpenPOWER on IntegriCloud