Module: sip-router Branch: alexh/master Commit: 99f314429cea4341240836e9c9d62c38176eae12 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=99f31442...
Author: Alex Hermann alex@speakup.nl Committer: Alex Hermann alex@speakup.nl Date: Fri Aug 5 15:32:14 2011 +0200
core: allow negative decimal numbers in configuration file parser
---
cfg.lex | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg.lex b/cfg.lex index ff35a8a..ecf92db 100644 --- a/cfg.lex +++ b/cfg.lex @@ -525,7 +525,7 @@ NUM_ID {ALPHANUM}+ HEX [0-9a-fA-F] HEXNUMBER 0x{HEX}+ OCTNUMBER 0[0-7]+ -DECNUMBER 0|([1-9]{DIGIT}*) +DECNUMBER 0|(-?[1-9]{DIGIT}*) BINNUMBER [0-1]+b HEX4 {HEX}{1,4} IPV6ADDR ({HEX4}":"){7}{HEX4}|({HEX4}":"){1,7}(":"{HEX4}){1,7}|":"(":"{HEX4}){1,7}|({HEX4}":"){1,7}":"|"::"
On Monday 08 August 2011, Alex Hermann wrote:
core: allow negative decimal numbers in configuration file parser
It seems this was previously possible, but has been removed. I don't know why, but my newly added function remove_branch(int) could benefit from negative arguments.
Any reason not to commit this patch?
On Aug 08, 2011 at 11:11, Alex Hermann alex@speakup.nl wrote:
Module: sip-router Branch: alexh/master Commit: 99f314429cea4341240836e9c9d62c38176eae12 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=99f31442...
Author: Alex Hermann alex@speakup.nl Committer: Alex Hermann alex@speakup.nl Date: Fri Aug 5 15:32:14 2011 +0200
core: allow negative decimal numbers in configuration file parser
You should use intno for that (defined inside cfg.y). The problem with adding '-' to DECNUMBER is that in most of cfg.y the assumption is that NUMBER is >= 0 and it will also probably interfere with subtraction ( e.g. $a - 1 will be parsed as $a (-1) => error).
Andrei
cfg.lex | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg.lex b/cfg.lex index ff35a8a..ecf92db 100644 --- a/cfg.lex +++ b/cfg.lex @@ -525,7 +525,7 @@ NUM_ID {ALPHANUM}+ HEX [0-9a-fA-F] HEXNUMBER 0x{HEX}+ OCTNUMBER 0[0-7]+ -DECNUMBER 0|([1-9]{DIGIT}*) +DECNUMBER 0|(-?[1-9]{DIGIT}*) BINNUMBER [0-1]+b HEX4 {HEX}{1,4} IPV6ADDR ({HEX4}":"){7}{HEX4}|({HEX4}":"){1,7}(":"{HEX4}){1,7}|":"(":"{HEX4}){1,7}|({HEX4}":"){1,7}":"|"::"
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev