bug: 允许文件直接以 EOF 结束 end module

This commit is contained in:
luke 2025-06-09 21:10:06 +08:00
parent 5106830b98
commit cd72761908

View File

@ -88,7 +88,6 @@ public class ModuleParser implements TopLevelParser {
// 确保模块体以 "end module" 结束 // 确保模块体以 "end module" 结束
ts.expect("end"); ts.expect("end");
ts.expect("module"); ts.expect("module");
ts.expectType(TokenType.NEWLINE);
// 构建并返回完整的模块语法树节点 // 构建并返回完整的模块语法树节点
return new ModuleNode(name, imports, functions); return new ModuleNode(name, imports, functions);