From 22df891893d30e9906d0b14fc3ae5d8e67d500b2 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sat, 3 Oct 2026 14:03:48 -0700 Subject: Chapter renumber, and split ch 17 Renumber chapters 10a, 10b, 11, 12, 13, 14 -> 10, 11, 13, 12, [11,14]. Split ch 17 into a 17a and 17b; shuffle around im/mutable syntax to be consistent, and present it more slowly. THe new immutable syntax is pushed through all later chapters --- chapter12/docs/12-grammar.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'chapter12/docs/12-grammar.md') diff --git a/chapter12/docs/12-grammar.md b/chapter12/docs/12-grammar.md index 4c071a98..24199ede 100644 --- a/chapter12/docs/12-grammar.md +++ b/chapter12/docs/12-grammar.md @@ -11,21 +11,21 @@ statement : returnStatement | structDeclaration | declStatement - | blockStatment + | blockStatement | expressionStatement | ifStatement | whileStatement | breakStatement - | continueStatment + | continueStatement ; PRIMTYPE : 'int' - | 'flt' ; field : PRIMTYPE IDENTIFIER ';' + | structName ('?')? IDENTIFIER ';' ; fields @@ -102,7 +102,7 @@ newExpression ; fieldExpression - : primaryExpresson '.' IDENTIFIER + : primaryExpression '.' IDENTIFIER ; primaryExpression @@ -122,7 +122,7 @@ INTEGER_LITERAL ; IDENTIFIER - : NON_DIGIT (NON_DIGIT | DIGIT)* + : NON_DIGIT (NON_DIGIT | DEC_DIGIT)* ; NON_DIGIT: [a-zA-Z_]; -- cgit v1.2.3