Based on BUTXO Programming Language
修订版 | 71069d521cfd1eb296e86453f5deaf87516e8a28 (tree) |
---|---|
时间 | 2018-10-25 18:05:10 |
作者 | oysheng <33340252+oysheng@user...> |
Commiter | Paladz |
fix contract exceptd check (#22)
@@ -48,6 +48,10 @@ func parse(buf []byte) (contracts []*Contract, err error) { | ||
48 | 48 | |
49 | 49 | func parseContracts(p *parser) []*Contract { |
50 | 50 | var result []*Contract |
51 | + if pos := scanKeyword(p.buf, p.pos, "contract"); pos < 0 { | |
52 | + p.errorf("expected contract") | |
53 | + } | |
54 | + | |
51 | 55 | for peekKeyword(p) == "contract" { |
52 | 56 | contract := parseContract(p) |
53 | 57 | result = append(result, contract) |