Summary: Previously, we would, for an empty file, print the somewhat confusing Assertion `tok == curTok [...]' failed. With this change, we now print Parse error [...]: expected 'def' [...] This only affects the parser from chapters 1-6, since the more advanced chapter 7 parser is actually able to generate an empty module from an empty file. Nonetheless, this commit also adds the additional check to the chapter 7 parser, for consistency. Differential Revision: https://reviews.llvm.org/D75534
4 lines
90 B
Plaintext
4 lines
90 B
Plaintext
# RUN: toyc-ch2 %s -emit=ast 2>&1 | FileCheck %s
|
|
# CHECK-NOT: Assert
|
|
# CHECK: Parse error
|