Unreleased
- Section 2.3:
- Correct spelling of “Earley parsing” (from “Early parsing”)
- Section 2.6:
- Remove confusing sentence about nil-checks
- Change vague sentence about precedence in parsing for-loop
- Section 3.5:
- Change phrasing
- Section 3.7:
- Change description of
evalStatement, that erroneously described it as a function used byevalProgramStatementsandevalBlockStatements(which both don’t exist)
- Change description of
- Section 4.2:
- Fix a typo by changing “in” to “into”
- Section 4.3:
- Adding missing test output for failing
lentest
- Adding missing test output for failing
7 May 2020 - 1.7
- Code:
- Added
go.modfiles to the code folder so that users with Go >= 1.13 can easily run it without having to set$GOPATH
- Added
- Section 1.5:
- Update wrong token types in example Lexer output
- Change from
fmt.Printftofmt.Fprintfto make use ofout
- Section 1.3:
- Fix a grammar mistake by removing the additional “the” in “Of the course”
- Section 2.9:
- Fix a typo by changing “intends” to “indents”
- Section 3.9:
- Change “How to we” to “How do we”
- Fix missing word in “we should bind it too” by rewriting sentence
20 March 2019 - 1.6
- Section 2.4:
- Fix wrong
parseOperatorExpressionin pseudo-code example for recursive-descent parser
- Fix wrong
- Section 2.5:
- Change wrong capitalization in test error message
- Section 4.5:
- Correct explanation of
HashKeyby clarifying thatObjectTypeis astring(as opposed to an integer)
- Correct explanation of
31 July 2018 - 1.5
Besides fixes for various typos and spelling errors:
- Chapter 2:
- Fix wrong mention of
program.Bodyin test error messages and change it toprogram.Statements
- Fix wrong mention of
- Section 1.3:
- Make it clearer where to put
import "monkey/token"line
- Make it clearer where to put
- Section 2.4:
- Fix wrong error message in
testLetStatementhelper function - Fix wrong indentation of
inputin test function - Fix missing imports of
fmtpackage
- Fix wrong error message in
- Section 2.5:
- Fix wrong mention of
ParsePrograminstead of the correctparseStatement
- Fix wrong mention of
- Section 2.6:
- Fix wrong explanation of failing test output in prefix operators section
- Fix wrong explanation of the for-loop condition in
parseExpression - Rename local variable
oetoiein*ast.InfixExpressionmethods
- Section 2.8:
- Change post-refactoring version of
TestParsingInfixExpressionsto make clearer that it has been refactored - Fix wrong error message in
testInfixExpression - Fix wrong output in test error message (“true” to “TRUE”)
- Add missing import of
stringspackage - Change wording to make clearer that the section includes changes to the existing test suite
- Change post-refactoring version of
- Section 2.9:
- Add the missing
importofmonkey/parserto the REPL code
- Add the missing
- Section 3.5:
- Fix wrong error message in failing test output for
TestEvalBooleanExpression
- Fix wrong error message in failing test output for
- Section 3.8:
- Add missing import of
fmt
- Add missing import of
- Section 3.10:
- Add missing import
- Chapter 4:
- Remove unused import of
unicode/utf8package
- Remove unused import of
- Section 4.5:
- Add note about hash collisions when explaining the
HashKeymethods - Fix wrong failing test output after adding a test to
TestErrorHandling
- Add note about hash collisions when explaining the
- Going Further:
- Add link to the sequel Writing A Compiler In Go.
28 June 2017 - 1.4
- Section 1.4:
- Use a local variable to save the
literalwhen creatingtoken.EQandtoken.NOT_EQ
- Use a local variable to save the
- Section 2.3:
- Fix a small typo
- Section 2.4:
- Change incorrect mention of
peekPositionin lexer to correctreadPosition
- Change incorrect mention of
- Section 2.6:
- Fix duplicate test input in
TestOperatorPrecedenceParsinghere and in the following sections where it’s referenced
- Fix duplicate test input in
- Section 3.9:
- In the first example the expression
5 * 5was used and the text explained that this should evaluate to10, which is wrong. It should evaluate to25, of course.
- In the first example the expression
- The Lost Chapter:
- Added a new section at the end of the book about The Lost Chapter: A Macro System For Monkey and where it can be found.
26 January 2017 - 1.3
- License of the code:
- The
codefolder and its content are now licensed under the MIT license. See theLICENSEfile and/or theREADME.mdfile.
- The
- Section 1.1:
- Make clear that whitespace is only significant in the sense that it separates tokens, but not its length.
- Section 1.3:
- Small wording change
- Fix wrong reference to
NextTokenwhenreadCharwas meant
- Section 2.8:
- Fix the
parseBlockStatementmethod so it doesn’t run into an endless loop when parsing incomplete input
- Fix the
- Section 4.2:
- Fix the
readStringmethod so it doesn’t run into an endless loop when a string in the input is not terminated with a closing double quote
- Fix the
- Section 4.4:
- Fix a typo in the error message of the builtin
pushfunction
- Fix a typo in the error message of the builtin
20 December 2016 - 1.2
- Section 2.8:
- Add a missing semicolon to the test input in
TestLetStatements
- Add a missing semicolon to the test input in
- Section 4.4:
- Fix the failing test for the builtin
pushfunction. Error was introduced with the last update. This change only occurrs in the code accompanying the book and only in subfolder04.
- Fix the failing test for the builtin
8 December 2016 - 1.1
Besides fixed typos and spelling errors:
- Introduction
- Change the “How To Use This Book” subsection to include a link to the downloadable archive of the accompanying code
- Section 1.4:
- Add hint about accompanying code
- Show the last, fully extended version of the test
inputforTestNextToken
- Section 2.6:
- The failing test output for
TestParsingPrefixExpressionsin the book text was wrong. It’s corrected to match the actual output one gets when building the parser from scratch - Fix wording that didn’t match the described test output
- Remove
token.LPARENfrom theprecedencestable here. It somehow slipped in at this point, but should only be added later on in section 2.8, where tests are supposed to fail because it’s missing
- The failing test output for
- Section 2.8:
- Fix wrong test expectation (
"x"changed to"y") inTestLetStatement - Change
parser_parser_test.gotoparser_test.go - Better show how to use
testLiteralExpressioninTestParsingInfixExpressions - Fix outdated test output for failing
TestOperatorPrecedenceParsing,TestIfExpression,TestIfElseExpression,TestFunctionLiteralParsing
- Fix wrong test expectation (
- Section 3.10:
- Change the
Inspect()method of*object.Functionto usefninstead offunctionand newlines in output - Remove needless semicolons in example
- Change the
- Section 3.5:
- Change from if/else to “if and return” in
nativeBoolToBooleanObject
- Change from if/else to “if and return” in
- Section 3.6:
- Update the version of
testNullObjectto be the one in the accompanying code, with a correct call tot.Errorf
- Update the version of
- Section 4.4:
- Name the
token.Tokenfield ofast.ArrayLiteral - Fix possible panic through nil error in “first”, “last”, “rest”, and “push” functions by adding separate check
- Name the
- Section 4.5:
- Name the
token.Tokenfield ofast.HashLiteral - Replace
nullin output with missing error message when trying to access hash via index expression before it’s implemented
- Name the
- Section 4.6:
- Change the expected output using
putswith a function literal to match the updatedInspect()of*object.Function - Explain the
nulls in the expected output ofputbetter
- Change the expected output using
23 November 2016 - 1.0
- Initial Release