Patch to the lexer to accept "1e+1"

Thomas Leonard <tal-v5nx5w6akNyLE8xUarVfuPLx9OUvmyODWmv/[email protected]> Thu, 29 Sep 2011 09:22:57 +0100
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
JSON allows "1e+1" as well as "1e1":

http://www.json.org/

However, E's JSON parser rejects it:

? def surgeon := <elib:serial.deJSONKit>.makeSurgeon()
? surgeon.unserialize("1e+1")
# value: 10.0

new syntax error: Missing exponent
#   1e+1
#   ^^

This patch fixes it:

http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/a2bf52beff24defc63bd8fe5cf1f8cfe85547c23

Note: a side-effect is that it also allows this syntax in regular E 
code. I assume that's not a problem?


-- 
Dr Thomas Leonard
IT Innovation Centre
Gamma House, Enterprise Road,
Southampton SO16 7NS, UK


tel: +44 23 8059 8866

mailto:tal-v5nx5w6akNyLE8xUarVfuPLx9OUvmyODWmv/[email protected]
http://www.it-innovation.soton.ac.uk/