ES6 Language Specification

The Numeric String Grammar

5.1.3 The Numeric String Grammar

There is a separate grammar used for converting Strings to numbers. It’s very similar to the lexical grammar in that it’s terminals are SourceCharacters or in other words Unicode characters. There’s really not much to say on this other than it is considered separate from the lexical grammar. It is not clear to me why we need to single this out into its own grammar, so if someone has an idea to why this is necessary then please comment below.

Another grammar is used for translating Strings into numeric values. This grammar is similar to the part of the lexical grammar having to do with numeric literals and has as its terminal symbols SourceCharacter. This grammar appears in 7.1.3.1.

Productions of the numeric string grammar are distinguished by having three colons “:::” as punctuation.

An interesting thing to note between this spec and ES5 is that ES6 has dropped the JSON Grammar defined in section 5.1.5 of the ES5 spec. I’m assuming this is because the JSON has made its way into ECMA-404

Josh Miller

Josh Miller Josh Miller

I’m a full-stack web developer who’s especially enthusiastic about the rapid developments in JavaScript. I’ve created this blog as a medium to share with others a journey of knowledge and discovery.

No Comments

Leave a comment