mirror of
https://github.com/danog/phpdoc-parser.git
synced 2024-11-30 04:29:20 +01:00
support negative numbers
This commit is contained in:
parent
523d45b7ef
commit
d973733eee
@ -9,15 +9,15 @@ ConstantExpr
|
||||
/ ConstantFetch
|
||||
|
||||
ConstantFloat
|
||||
= [0-9]+ '.' [0-9]* ConstantFloatExp?
|
||||
/ [0-9]* '.' [0-9]+ ConstantFloatExp?
|
||||
/ [0-9]+ ConstantFloatExp
|
||||
= '-'? [0-9]+ '.' [0-9]* ConstantFloatExp?
|
||||
/ '-'? [0-9]* '.' [0-9]+ ConstantFloatExp?
|
||||
/ '-'? [0-9]+ ConstantFloatExp
|
||||
|
||||
ConstantFloatExp
|
||||
= [eE] [0-9]+
|
||||
= [eE] '-'? [0-9]+
|
||||
|
||||
ConstantInt
|
||||
= [0-9]+
|
||||
= '-'? [0-9]+
|
||||
|
||||
ConstantTrue
|
||||
= [tT][rR][uU][eE]
|
||||
|
@ -131,8 +131,8 @@ class Lexer
|
||||
self::TOKEN_CLOSE_PHPDOC => '\\*/',
|
||||
self::TOKEN_PHPDOC_TAG => '@[a-z-]++',
|
||||
|
||||
self::TOKEN_FLOAT => '(?:[0-9]++\\.[0-9]*+(?:e[0-9]++)?)|(?:[0-9]*+\\.[0-9]++(?:e[0-9]++)?)|(?:[0-9]++e[0-9]++)',
|
||||
self::TOKEN_INTEGER => '[0-9]++',
|
||||
self::TOKEN_FLOAT => '(?:-?[0-9]++\\.[0-9]*+(?:e-?[0-9]++)?)|(?:-?[0-9]*+\\.[0-9]++(?:e-?[0-9]++)?)|(?:-?[0-9]++e-?[0-9]++)',
|
||||
self::TOKEN_INTEGER => '-?[0-9]++',
|
||||
self::TOKEN_SINGLE_QUOTED_STRING => '\'(?:\\\\.|[^\'])*+\'',
|
||||
self::TOKEN_DOUBLE_QUOTED_STRING => '"(?:\\\\.|[^"])*+"',
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user