I started reading JavaScript: The Good Parts book and became confused at first pages (7 and 9 if be exact) by the railroad diagrams.
There are diagrams for the name and the string literal. (you can see the diagrams here)
As I know names in JavaScript can start with letters as well as with underscore or even ‘$’ symbol. Following by the book’s diagram it can starts only from letters.
For the string literal, imagine that you want to represent string like that: “\\”.
Following by the diagram it’s not possible(seems like after the “escaped character” the “any unicode character except ” and \ and contol” is required.
Are those an errors in the book? Or I miss something?
The language described in the book “The Good Parts” is not JavaScript but a subset of it – you can call it “Crockford’s JavaScript”. Crockford introduces new syntax restrictions. One of those restrictions is that names cannot start with
$or_.