[asterisk-commits] trunk r23151 - in /trunk/pbx/ael: ael.flex
ael_lex.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Fri Apr 28 08:24:30 MST 2006
Author: rizzo
Date: Fri Apr 28 10:24:30 2006
New Revision: 23151
URL: http://svn.digium.com/view/asterisk?rev=23151&view=rev
Log:
fix a bug in computing line numbers
Modified:
trunk/pbx/ael/ael.flex
trunk/pbx/ael/ael_lex.c
Modified: trunk/pbx/ael/ael.flex
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael.flex?rev=23151&r1=23150&r2=23151&view=diff
==============================================================================
--- trunk/pbx/ael/ael.flex (original)
+++ trunk/pbx/ael/ael.flex Fri Apr 28 10:24:30 2006
@@ -78,7 +78,7 @@
* current line, column and filename, updated as we read the input.
*/
static int my_lineno = 1; /* current line in the source */
-static int my_col = 0; /* current column in the source */
+static int my_col = 1; /* current column in the source */
char *my_file = 0; /* used also in the bison code */
char *prev_word; /* XXX document it */
@@ -155,7 +155,7 @@
#define STORE_END do { \
pbcwhere(yytext, &my_lineno, &my_col); \
yylloc->last_line = my_lineno; \
- yylloc->last_column = my_col; \
+ yylloc->last_column = my_col - 1; \
} while (0)
#else
#define STORE_POS
@@ -253,7 +253,7 @@
<paren>{NOPARENS}[\(\[\{] {
char c = yytext[yyleng-1];
- STORE_START;
+ // STORE_START;
if (c == '(')
parencount++;
pbcpush(c);
@@ -293,11 +293,11 @@
return word;
}
- STORE_END;
parencount--;
if( parencount >= 0){
yymore();
} else {
+ STORE_END;
yylval->str = strdup(yytext);
if(yyleng > 1 )
*(yylval->str+yyleng-1)=0;
Modified: trunk/pbx/ael/ael_lex.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael_lex.c?rev=23151&r1=23150&r2=23151&view=diff
==============================================================================
--- trunk/pbx/ael/ael_lex.c (original)
+++ trunk/pbx/ael/ael_lex.c Fri Apr 28 10:24:30 2006
@@ -694,7 +694,7 @@
* current line, column and filename, updated as we read the input.
*/
static int my_lineno = 1; /* current line in the source */
-static int my_col = 0; /* current column in the source */
+static int my_col = 1; /* current column in the source */
char *my_file = 0; /* used also in the bison code */
char *prev_word; /* XXX document it */
@@ -771,7 +771,7 @@
#define STORE_END do { \
pbcwhere(yytext, &my_lineno, &my_col); \
yylloc->last_line = my_lineno; \
- yylloc->last_column = my_col; \
+ yylloc->last_column = my_col - 1; \
} while (0)
#else
#define STORE_POS
@@ -1365,7 +1365,7 @@
#line 254 "ael.flex"
{
char c = yytext[yyleng-1];
- STORE_START;
+ // STORE_START;
if (c == '(')
parencount++;
pbcpush(c);
@@ -1417,11 +1417,11 @@
return word;
}
- STORE_END;
parencount--;
if( parencount >= 0){
yymore();
} else {
+ STORE_END;
yylval->str = strdup(yytext);
if(yyleng > 1 )
*(yylval->str+yyleng-1)=0;
More information about the asterisk-commits
mailing list