Skip to content

Commit

Permalink
Fixed little grammar bug where the fractional part of a number was re…
Browse files Browse the repository at this point in the history
…quired when written in an exponential form (i.e.: a number like 1e10 was considered as invalid and required to be written as 1.0e10).

git-svn-id: http://svn.textmate.org/trunk/Bundles/JSON.tmbundle@11943 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
David Bonnet committed Jun 9, 2010
1 parent 4726aa2 commit c7f2f58
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions Syntaxes/JSON.tmLanguage
Expand Up @@ -99,23 +99,25 @@
<string>handles integer and decimal numbers</string>
<key>match</key>
<string>(?x: # turn on extended mode
-? # an optional minus
(?:
0 # a zero
| # ...or...
[1-9] # a 1-9 character
\d* # followed by zero or more digits
)
(?:
\. # a period
\d+ # followed by one or more digits
(?:
[eE] # an e character
[+-]? # followed by an option +/-
\d+ # followed by one or more digits
)? # make exponent optional
)? # make decimal portion optional
)</string>
-? # an optional minus
(?:
0 # a zero
| # ...or...
[1-9] # a 1-9 character
\d* # followed by zero or more digits
)
(?:
(?:
\. # a period
\d+ # followed by one or more digits
)?
(?:
[eE] # an e character
[+-]? # followed by an option +/-
\d+ # followed by one or more digits
)? # make exponent optional
)? # make decimal portion optional
)</string>
<key>name</key>
<string>constant.numeric.json</string>
</dict>
Expand Down

0 comments on commit c7f2f58

Please sign in to comment.