From c7f2f585c7ecf9e9c2b068b4b1a211a2deedea5d Mon Sep 17 00:00:00 2001 From: David Bonnet Date: Wed, 9 Jun 2010 15:12:15 +0000 Subject: [PATCH] Fixed little grammar bug where the fractional part of a number was required 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 --- Syntaxes/JSON.tmLanguage | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Syntaxes/JSON.tmLanguage b/Syntaxes/JSON.tmLanguage index 03bca45..e299ca1 100644 --- a/Syntaxes/JSON.tmLanguage +++ b/Syntaxes/JSON.tmLanguage @@ -99,23 +99,25 @@ handles integer and decimal numbers match (?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 - ) + -? # 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 + ) name constant.numeric.json