aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin T. Gibbs <gibbs@FreeBSD.org>2003-12-16 23:54:07 +0000
committerJustin T. Gibbs <gibbs@FreeBSD.org>2003-12-16 23:54:07 +0000
commit708d2cb0296d9e1ab663096360204bcb3eba12ff (patch)
treef97c2c9d07607d7f5ef6973500aaed4f3806598b
parent1d1daa2f0023d3dbbdd866e5bbe838b3c85f961b (diff)
Notes
-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 d781443f56a3..f06e7035cb35 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 e4dc6fd359ba..45c0b233d0bc 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;