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