Re: Patch to the lexer to accept "1e+1"
Kevin Reid <kpreid-M/[email protected]> Thu, 29 Sep 2011 07:50:15 -0400
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Sep 29, 2011, at 4:22, Thomas Leonard wrote:
> 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?
Given that '-' is allowed I see no problem with '+'. I also see that C, for example, accepts a '+' in float syntax.
It is in general a good thing to improve the similarity of E's syntax for values such as strings (backslash escapes) and floats (exponent syntax) to the syntax used by many other programming languages, except where E deliberately is restrictive for robustness reasons ("make the programmer clarify what they meant").
Go ahead with this.
--
Kevin Reid <http://switchb.org/kpreid/>