Skip to content

Commit 8ee3238

Browse files
tohavagraydon
authored andcommitted
---
yaml --- r: 731 b: refs/heads/master c: 74cb950 h: refs/heads/master i: 729: 8854bdb 727: 8a94498 v: v3
1 parent 5b50613 commit 8ee3238

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b970563fe3f36853250f4cef65a8425431789e8b
2+
refs/heads/master: 74cb9508cd122b7863f179c69c406e0f47572354

trunk/src/boot/fe/item.ml

+10-1
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,21 @@ and parse_auto_slot_and_init
148148
let stmts = ctxt "slot, ident and init: init" (parse_init lval) ps in
149149
(stmts, slot_auto, ident)
150150

151+
152+
and parse_stmts (ps:pstate) : Ast.stmt array =
153+
let arr = parse_stmts_including_none ps in
154+
if (Array.length arr) == 0 then
155+
raise (err "statement does nothing" ps);
156+
arr
157+
158+
159+
151160
(*
152161
* We have no way to parse a single Ast.stmt; any incoming syntactic statement
153162
* may desugar to N>1 real Ast.stmts
154163
*)
155164

156-
and parse_stmts (ps:pstate) : Ast.stmt array =
165+
and parse_stmts_including_none (ps:pstate) : Ast.stmt array =
157166
let apos = lexpos ps in
158167

159168
let ensure_mutable slot =
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// error-pattern: does nothing
2+
fn main() {
3+
log "doing";
4+
this_does_nothing_what_the;
5+
log "boing";
6+
}
7+

0 commit comments

Comments
 (0)