IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 22, 2006, 2:26:50 PM (20 years ago)
Author:
jhoblitt
Message:

add float nan/inf support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Metadata-Config/config_grammar.txt

    r8583 r8888  
    11# Copyright (c) 2005  Joshua Hoblitt
    22#
    3 # $Id: config_grammar.txt,v 1.1 2006-08-25 03:08:56 jhoblitt Exp $
     3# $Id: config_grammar.txt,v 1.2 2006-09-23 00:26:50 jhoblitt Exp $
    44
    55{
     
    289289    /(?:(?:[+-]?)(?:[0-9]+))/
    290290
     291    # based on $RE{num}{real} from Regexp::Common::number
    291292float:
    292     # based on $RE{num}{real} from Regexp::Common::number
    293293    /(?:(?i)(?:[+-]?)(?:(?=[0-9]|[.])(?:[0-9]*)(?:(?:[.])(?:[0-9]{0,}))?)(?:(?:[Ee])(?:(?:[+-]?)(?:[0-9]+))|))/
     294    | inf
     295    | nan
     296
     297inf:
     298    /[+-]?inf(?:inity)?/i
     299        {
     300            if ($item[1] =~ /^-/) {
     301                $return = "-inf";
     302            } else {
     303                $return = "+inf";
     304            }
     305        }
     306nan:
     307    /[+-]?nan(?:\(\S*?\))?/i
     308        { $return = "nan" }
    294309
    295310bool:
Note: See TracChangeset for help on using the changeset viewer.