[asterisk-commits] trunk r23130 - in /trunk/pbx/ael: ./ ael-test/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 28 07:17:04 MST 2006


Author: rizzo
Date: Fri Apr 28 09:17:03 2006
New Revision: 23130

URL: http://svn.digium.com/view/asterisk?rev=23130&view=rev
Log:
- fix miscalculation in column numbers when multiple tabs
  or empty lines are involved;
- change linku1() to return the head of the list (unused at the moment);
- ignore the source line number in runtests as they change with the
  source and cause mismatches in the comparison with the reference output.


Modified:
    trunk/pbx/ael/ael-test/runtests
    trunk/pbx/ael/ael.flex
    trunk/pbx/ael/ael.tab.c
    trunk/pbx/ael/ael.y
    trunk/pbx/ael/ael_lex.c

Modified: trunk/pbx/ael/ael-test/runtests
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael-test/runtests?rev=23130&r1=23129&r2=23130&view=diff
==============================================================================
--- trunk/pbx/ael/ael-test/runtests (original)
+++ trunk/pbx/ael/ael-test/runtests Fri Apr 28 09:17:03 2006
@@ -1,9 +1,12 @@
 #!/bin/bash
-
+ORIG=`mktemp /tmp/mytest.XXXXXX`
+NEW=`mktemp /tmp/mytest.XXXXXX`
 for i in ael-test*; do
 	echo -n Test: $i..................
 	(cd $i; ../../../../utils/aelparse -n -d | grep -v -i 'seconds' > ../res.$i)
-	if (diff -q res.$i ref.$i > /dev/null 2>&1 ) then
+	sed 's/line:[0-9]*//; /^Executed.*/d' < res.$i > $NEW
+	sed 's/line:[0-9]*//; /^Executed.*/d' < ref.$i > $ORIG
+	if (diff -q $NEW $ORIG > /dev/null 2>&1 ) then
 		echo PASSED
 		rm res.$i
 	else
@@ -12,3 +15,4 @@
 	fi
 
 done
+rm $NEW $ORIG

Modified: trunk/pbx/ael/ael.flex
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael.flex?rev=23130&r1=23129&r2=23130&view=diff
==============================================================================
--- trunk/pbx/ael/ael.flex (original)
+++ trunk/pbx/ael/ael.flex Fri Apr 28 09:17:03 2006
@@ -213,9 +213,9 @@
 eswitches	{ STORE_POS; return KW_ESWITCHES;}
 includes	{ STORE_POS; return KW_INCLUDES;}
 
-\n		{ my_lineno++; my_col = 0; }
+\n		{ my_lineno++; my_col = 1; }
 [ ]+		{ my_col += yyleng; }
-[\t]+		{ my_col += 8-(my_col%8); }
+[\t]+		{ my_col += (yyleng*8)-(my_col%8); }
 
 [-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]][-a-zA-Z0-9'"_/.!\*\+\<\>\{\}$#\[\]]*	{
 		STORE_POS;

Modified: trunk/pbx/ael/ael.tab.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael.tab.c?rev=23130&r1=23129&r2=23130&view=diff
==============================================================================
--- trunk/pbx/ael/ael.tab.c (original)
+++ trunk/pbx/ael/ael.tab.c Fri Apr 28 09:17:03 2006
@@ -185,7 +185,7 @@
 static pval *npval(pvaltype type, int first_line, int last_line,
 	int first_column, int last_column);
 
-static void linku1(pval *head, pval *tail);
+static pval * linku1(pval *head, pval *tail);
 
 void reset_parencount(yyscan_t yyscanner);
 void reset_semicount(yyscan_t yyscanner);
@@ -3521,14 +3521,17 @@
 }
 
 /* append second element to the list in the first one */
-static void linku1(pval *head, pval *tail)
+static pval * linku1(pval *head, pval *tail)
 {
+	if (!head)
+		return tail;
 	if (!head->next) {
 		head->next = tail;
 	} else {
 		head->u1_last->next = tail;
 	}
 	head->u1_last = tail;
+	return head;
 }
 
 

Modified: trunk/pbx/ael/ael.y
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael.y?rev=23130&r1=23129&r2=23130&view=diff
==============================================================================
--- trunk/pbx/ael/ael.y (original)
+++ trunk/pbx/ael/ael.y Fri Apr 28 09:17:03 2006
@@ -32,7 +32,7 @@
 static pval *npval(pvaltype type, int first_line, int last_line,
 	int first_column, int last_column);
 
-static void linku1(pval *head, pval *tail);
+static pval * linku1(pval *head, pval *tail);
 
 void reset_parencount(yyscan_t yyscanner);
 void reset_semicount(yyscan_t yyscanner);
@@ -959,13 +959,16 @@
 }
 
 /* append second element to the list in the first one */
-static void linku1(pval *head, pval *tail)
+static pval * linku1(pval *head, pval *tail)
 {
+	if (!head)
+		return tail;
 	if (!head->next) {
 		head->next = tail;
 	} else {
 		head->u1_last->next = tail;
 	}
 	head->u1_last = tail;
+	return head;
 }
 

Modified: trunk/pbx/ael/ael_lex.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael_lex.c?rev=23130&r1=23129&r2=23130&view=diff
==============================================================================
--- trunk/pbx/ael/ael_lex.c (original)
+++ trunk/pbx/ael/ael_lex.c Fri Apr 28 09:17:03 2006
@@ -1309,7 +1309,7 @@
 /* rule 40 can match eol */
 YY_RULE_SETUP
 #line 216 "ael.flex"
-{ my_lineno++; my_col = 0; }
+{ my_lineno++; my_col = 1; }
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
@@ -1319,7 +1319,7 @@
 case 42:
 YY_RULE_SETUP
 #line 218 "ael.flex"
-{ my_col += 8-(my_col%8); }
+{ my_col += (yyleng*8)-(my_col%8); }
 	YY_BREAK
 case 43:
 YY_RULE_SETUP



More information about the asterisk-commits mailing list