An example of the third basic rule of semicolon insertion

heathmatlock heathmatlock at gmail.com
Sat Jan 19 23:05:46 PST 2013


I was looking through the section on ASI again, and I'm unsure which
is a valid example of the third basic rule which states:

"When, as the program is parsed from left to right, a token is
encountered that is allowed by some production of the grammar, but the
production is a restricted production and the token would be the first
token for a terminal or nonterminal immediately following the
annotation '[no LineTerminator here]' within the restricted production
(and therefore such a token is called a restricted token), and the
restricted token is separated from the previous token by at least one
LineTerminator, then a semicolon is automatically inserted before the
restricted token."

I looked at the examples section, and the only statement that might be
valid for this rule is the return\n a + b example, but that seems more
like a chance against a line terminator which is what the first rule
does.

Would anyone care to offer an example or explain how the example
mentioned above should be handled by the third rule?

--
Heath Matlock
+1 256 274 4225


More information about the es-discuss mailing list