diff --git a/ase/awk/awk.h b/ase/awk/awk.h index 747369d8..e627e5e4 100644 --- a/ase/awk/awk.h +++ b/ase/awk/awk.h @@ -1,5 +1,5 @@ /* - * $Id: awk.h,v 1.56 2006-04-24 11:25:59 bacon Exp $ + * $Id: awk.h,v 1.57 2006-04-24 11:36:12 bacon Exp $ */ #ifndef _XP_AWK_AWK_H_ @@ -30,12 +30,13 @@ enum /* parse options */ enum { - XP_AWK_IMPLICIT = (1 << 0), /* allow undeclared variables */ - XP_AWK_EXPLICIT = (1 << 1), /* variable requires explicit declaration */ - XP_AWK_UNIQUE = (1 << 2), /* a function name should not coincide to be a variable name */ - XP_AWK_SHADING = (1 << 3), /* allow variable shading */ - XP_AWK_SHIFT = (1 << 4), /* support shift operators */ - XP_AWK_HASHSIGN = (1 << 5) /* support comments by a hash sign */ + XP_AWK_IMPLICIT = (1 << 0), /* allow undeclared variables */ + XP_AWK_EXPLICIT = (1 << 1), /* variable requires explicit declaration */ + XP_AWK_UNIQUE = (1 << 2), /* a function name should not coincide to be a variable name */ + XP_AWK_SHADING = (1 << 3), /* allow variable shading */ + XP_AWK_SHIFT = (1 << 4), /* support shift operators */ + XP_AWK_HASHSIGN = (1 << 5), /* support comments by a hash sign */ + XP_AWK_DBLSLASHES = (1 << 6) /* support comments by double slashes */ }; /* run options */ diff --git a/ase/awk/parse.c b/ase/awk/parse.c index 1172ac4d..9680cd2f 100644 --- a/ase/awk/parse.c +++ b/ase/awk/parse.c @@ -1,5 +1,5 @@ /* - * $Id: parse.c,v 1.89 2006-04-24 11:25:59 bacon Exp $ + * $Id: parse.c,v 1.90 2006-04-24 11:36:12 bacon Exp $ */ #include @@ -2571,7 +2571,6 @@ static int __get_token (xp_awk_t* awk) } else if (c == XP_CHAR('/')) { -/* TODO: handle regular expression here... /^pattern$/ */ GET_CHAR_TO (awk, c); if (c == XP_CHAR('=')) @@ -2925,7 +2924,7 @@ static int __skip_comment (xp_awk_t* awk) if (c != XP_CHAR('/')) return 0; /* not a comment */ GET_CHAR_TO (awk, c); - if (c == XP_CHAR('/')) + if ((awk->opt.parse & XP_AWK_DBLSLASHES) && c == XP_CHAR('/')) { do {