On Aug 08, 2011 at 11:11, Alex Hermann <[email protected]> wrote:
> Module: sip-router
> Branch: alexh/master
> Commit: 99f314429cea4341240836e9c9d62c38176eae12
> URL:    
> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=99f314429cea4341240836e9c9d62c38176eae12
> 
> Author: Alex Hermann <[email protected]>
> Committer: Alex Hermann <[email protected]>
> 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
> [email protected]
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to