dect
/
asterisk
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
asterisk/pbx/ael/ael-test
murf 98ba3dd3c0 Merged revisions 141094 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r141094 | murf | 2008-09-04 17:15:07 -0600 (Thu, 04 Sep 2008) | 70 lines

(closes issue #13357)
Reported by: pj
Tested by: murf

(closes issue #13416)
Reported by: yarns
Tested by: murf

If you find this message overly verbose, relax, it's probably
not meant for you. This message is meant for probably only
two people in the whole world: me, or the poor schnook that
has to maintain this code because I'm either dead or unavailable
at the moment.

This fix solves two reports, both having to do with embedding
a function call in a ${} construct. It was tricky because the
funccall syntax has parenthesis () in it. And up till now,
the 'word' token in the flex stuff didn't allow that, because
it would tend to steal the LP and RP tokens. To be truthful,
the "word" token was the trickiest, most unstable thing in
the whole lexer. I was lucky it made this long without complaints.
I had to choose every character in the pattern with extreme
care, and I knew that someday I'd have to revisit it. Well,
the day has come.

So, my brilliant idea (and I'm being modest), was to use the 
surrounding ${} construct to make a state machine and capture 
everything in it, no matter what it contains. But, I have to now
treat the word token like I did with comments, in that I turn
the whole thing into a state-machine sort of spec, with new
contexts "curlystate", "wordstate", and "brackstate".

Wait a minute, "brackstate"? Yes, well, it didn't take very many
regression tests to point out if I do this for ${} constructs,
I also have to do it with the $[] constructs, too.

I had to create a separate pcbstack2 and pcbstack3 because
these constructs can occur inside macro argument lists, and
when we have two state machines operating on the same structures
we'd get problems otherwise. I guess I could have stopped at
pcbstack2 and had the brackstate stuff share it, but it doesn't
hurt to be safe. So, the pcbpush and pcbpop routines also now
have versions for "2" and "3".

I had to add the {KEYWORD} construct to the initial pattern for
"word", because previously word would match stuff like "default7",
because it was a longer match than the keyword "default". But,
not any more, because the word pattern only matches only one or
two characters now, and it will always lose. So, I made it the
winner again by making an optional match on any of the keywords
before it's normal pattern.

I added another regression test to make sure we don't
lose this in future edits, and had to fix just one regression,
where it no longer reports a 'cascaded' error, which I guess
is a plus.

I've given some thought as to whether to apply these fixes to
1.4 and the 1.6.x releases, vs trunk; I decided to put it in
1.4 because one of the bug reports was against 1.4; and it
is unexpected that AEL cannot handle this situation. It actually
reduced the amount of useless "cascade" error messages that
appeared in the regressions (by one line, ehhem). There is
a possible side-effect in that it does now do more careful
checking of what's in those ${} constructs, as far as matching
parens, and brackets are concerned. Some users may find a an
insidious problem and correct it this way. This should be 
exceedingly rare, I hope.


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@141115 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-04 23:31:41 +00:00
..
ael-ntest9 OK, here is everything I changed to fix 7474: 2006-07-06 22:49:18 +00:00
ael-ntest10 The contents of branch teams/murf/bug_7598 are being folded in here. 2006-08-07 12:59:47 +00:00
ael-ntest12 This branch will resolve the bug 7635. 2006-08-01 19:03:32 +00:00
ael-ntest22 the last commit for AEL affected a small number of tests. Added a regression test for glob'd includes 2007-09-29 22:40:58 +00:00
ael-ntest23 Merged revisions 109309 via svnmerge from 2008-03-18 14:09:50 +00:00
ael-ntest24 (closes issue #12467) 2008-04-21 21:13:02 +00:00
ael-test1 This commit merges the contents of 7721, as it applied to the trunk version. Added the item that would previously trigger a false error to test1. 2006-08-12 19:28:33 +00:00
ael-test2 Merge Steve Murphy's (murf) complete re-implementation of AEL, which is now no longer considered experimental :-) 2006-04-24 17:41:27 +00:00
ael-test3 Change all instances of "CALLERID(number)" to "CALLERID(num)" for 2007-11-26 23:15:53 +00:00
ael-test4 Merge Steve Murphy's (murf) complete re-implementation of AEL, which is now no longer considered experimental :-) 2006-04-24 17:41:27 +00:00
ael-test5 Merged revisions 79255 via svnmerge from 2007-08-14 14:32:21 +00:00
ael-test6 Merged revisions 79255 via svnmerge from 2007-08-14 14:32:21 +00:00
ael-test7 Change all instances of "CALLERID(number)" to "CALLERID(num)" for 2007-11-26 23:15:53 +00:00
ael-test8 merge changes from team/murf/AEL-trunk-fixesonly 2006-06-18 21:36:24 +00:00
ael-test11 This commits the changes to AEL to use the gosub-with-args from Tilghman to perform macro calls. This results in substantially smaller stack footprint, which allows macro call depths in excess of 100,000 levels, rather than the limit of 7 calls deep, which the Macro app is subject to. 2006-09-27 03:45:22 +00:00
ael-test14 Changes to fix all problems reported in 7804 are included here. 2006-08-25 20:43:51 +00:00
ael-test15 This commit is a basic AEL enhancement: c-style comments 2006-08-31 02:53:15 +00:00
ael-test16 These changes resolve the problems in bug 8090, where there's a crash compiling an empty context 2006-10-04 19:33:37 +00:00
ael-test18 added the no. 18 regression test 2007-03-26 22:24:16 +00:00
ael-test19 Change all instances of "CALLERID(number)" to "CALLERID(num)" for 2007-11-26 23:15:53 +00:00
ael-test20 Merged revisions 62883 via svnmerge from 2007-05-03 14:24:00 +00:00
ael-vtest13 Change all instances of "CALLERID(number)" to "CALLERID(num)" for 2007-11-26 23:15:53 +00:00
ael-vtest17 Correction for bug 8128 in trunk 2006-10-13 18:08:33 +00:00
ael-vtest21 Merged revisions 79255 via svnmerge from 2007-08-14 14:32:21 +00:00
ael-vtest25 Merged revisions 141094 via svnmerge from 2008-09-04 23:31:41 +00:00
ref.ael-ntest9 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-ntest10 Merged revisions 136726 via svnmerge from 2008-08-08 00:48:35 +00:00
ref.ael-ntest12 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-ntest22 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-ntest23 Merged revisions 109309 via svnmerge from 2008-03-18 14:09:50 +00:00
ref.ael-ntest24 (closes issue #12467) 2008-04-21 21:13:02 +00:00
ref.ael-test1 Merged revisions 119966 via svnmerge from 2008-06-03 15:49:34 +00:00
ref.ael-test2 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-test3 Merged revisions 119966 via svnmerge from 2008-06-03 15:49:34 +00:00
ref.ael-test4 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-test5 Merged revisions 119966 via svnmerge from 2008-06-03 15:49:34 +00:00
ref.ael-test6 Merged revisions 141094 via svnmerge from 2008-09-04 23:31:41 +00:00
ref.ael-test7 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-test8 Merged revisions 136726 via svnmerge from 2008-08-08 00:48:35 +00:00
ref.ael-test11 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-test14 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-test15 Merged revisions 119966 via svnmerge from 2008-06-03 15:49:34 +00:00
ref.ael-test16 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-test18 Merged revisions 136726 via svnmerge from 2008-08-08 00:48:35 +00:00
ref.ael-test19 Merged revisions 136726 via svnmerge from 2008-08-08 00:48:35 +00:00
ref.ael-test20 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also. 2007-11-27 18:50:44 +00:00
ref.ael-vtest13 Merged revisions 136726 via svnmerge from 2008-08-08 00:48:35 +00:00
ref.ael-vtest17 Merged revisions 119966 via svnmerge from 2008-06-03 15:49:34 +00:00
ref.ael-vtest21 Merged revisions 119966 via svnmerge from 2008-06-03 15:49:34 +00:00
ref.ael-vtest25 Merged revisions 141094 via svnmerge from 2008-09-04 23:31:41 +00:00
runtests This bug adds enhancement as per bug 7606, the -w 2006-08-09 01:16:37 +00:00
setref Merge Steve Murphy's (murf) complete re-implementation of AEL, which is now no longer considered experimental :-) 2006-04-24 17:41:27 +00:00