@@ -175,6 +175,17 @@ which case suits best (see image 1)
175175
176176!images/ch_contextual_transittobeg.jpg(Transition to `EXPR_BEG`)!
177177
178+ ((errata:<br>
179+ 1. Actually when the state is `EXPR_DOT`, the state after reading a
180+ `tIDENTIFIER` would be either `ARG` or `CMDARG`.
181+ However, because the author wanted to roughly group them as `FNAME/DOT` and the
182+ others here, these two are shown together.
183+ Therefore, to be precise, `EXPR_FNAME` and `EXPR_DOT` should have also been
184+ separated.<br>
185+ 2. '`)`' does not cause the transition from "everything else" to `EXPR_BEG`.
186+ ))
187+
188+
178189This does indeed look like the head of statement. Especially the `'\n'` and the
179190`';'` The open parentheses and the comma also suggest that it’s the head not
180191just of the statement, but of the expression as well.
@@ -224,7 +235,7 @@ For more information, see the section “The `do` conflict”
224235* `EXPR_END`
225236
226237Used when there is a possibility that the statement is terminal. For example,
227- after a literal or brackets . Except for cases when `EXPR_ENDARG` is used
238+ after a literal or a closing parenthesis . Except for cases when `EXPR_ENDARG` is used
228239
229240* `EXPR_ENDARG`
230241
@@ -882,6 +893,14 @@ MSB← →LSB
882893...0000000010 COND_LEXPOP()
883894</pre>
884895
896+ ((errata:<br>
897+ It leaves `COND_P()` only when it is 1.
898+ When `COND_P()` is 0 and the second bottom bit is 1,
899+ it would become 1 after doing LEXPOP,
900+ thus `COND_P()` is not left in this case.
901+ ))
902+
903+
885904Now I will explain what that means.
886905
887906h4. Investigating the function
@@ -1680,6 +1699,17 @@ The decision-making part using `EXPR_ENDARG` is the same as `tLBRACE_ARG` so
16801699priorities shouldn’t be an issue here. Similarly to `'{'` the right course of
16811700action is probably to make it `kDO_BLOCK`
16821701
1702+ ((errata:<br>
1703+ In the following case, priorities should have an influence.
1704+ (But it does not in the actual code. It means this is a bug.)
1705+
1706+ <pre>
1707+ m m (a) { ... } # This should be interpreted as m(m(a) {...}),
1708+ # but is interpreted as m(m(a)) {...}
1709+ m m (a) do ... end # as the same as this: m(m(a)) do ... end
1710+ </pre>
1711+ ))
1712+
16831713The problem lies with `CMDARG_P()` and `EXPR_CMDARG`. Let’s look at both.
16841714
16851715h4. `CMDARG_P()`
@@ -1868,6 +1898,10 @@ m(m _
18681898m m _
18691899</pre>
18701900
1901+ ((errata:<br>
1902+ The third one "m m _" is not `EXPR_CMDARG`. (It is `EXPR_ARG`.)
1903+ ))
1904+
18711905h4. Conclusion
18721906
18731907Let us now return to the `do` decision code.
@@ -2011,6 +2045,14 @@ tell you everything. It can’t tell anything other than what the reader infers.
20112045
20122046And with this very useful sermon, I close the chapter.
20132047
2048+ ((errata:<br>
2049+ This confidently written conclusion was wrong.
2050+ Without `EXPR_CMDARG`, for instance, this program "`m (m do end)`" cannot be
2051+ parsed. This is an example of the fact that correctness is not proved even if
2052+ dynamic analyses are done so many times.
2053+ ))
2054+
2055+
20142056h4. Still not the end
20152057
20162058Another thing I forgot. I can’t end the chapter without explaining why
0 commit comments