From 71069d521cfd1eb296e86453f5deaf87516e8a28 Mon Sep 17 00:00:00 2001 From: oysheng <33340252+oysheng@users.noreply.github.com> Date: Thu, 25 Oct 2018 17:05:10 +0800 Subject: [PATCH] fix contract exceptd check (#22) --- compiler/parse.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/parse.go b/compiler/parse.go index 4848aee..956825e 100644 --- a/compiler/parse.go +++ b/compiler/parse.go @@ -48,6 +48,10 @@ func parse(buf []byte) (contracts []*Contract, err error) { func parseContracts(p *parser) []*Contract { var result []*Contract + if pos := scanKeyword(p.buf, p.pos, "contract"); pos < 0 { + p.errorf("expected contract") + } + for peekKeyword(p) == "contract" { contract := parseContract(p) result = append(result, contract) -- 2.11.0