Commit 0c1f905a authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

CmmParse: Emit source notes for assignments

Currently the line information for bare source C-- is rather spartan. These add
notes for assignments, which tend to be useful to identify. Unfortunately, we
had to settle for approximate source locations as none of the parsers in
CmmParse return located things. However, I don't think it's worth changing this.
parent d55bea14
......@@ -593,9 +593,9 @@ stmt :: { CmmParse () }
| lreg '=' expr ';'
{ do reg <- $1; e <- $3; emitAssign reg e }
{ do reg <- $1; e <- $3; withSourceNote $2 $4 (emitAssign reg e) }
| type '[' expr ']' '=' expr ';'
{ doStore $1 $3 $6 }
{ withSourceNote $2 $7 (doStore $1 $3 $6) }
-- Gah! We really want to say "foreign_results" but that causes
-- a shift/reduce conflict with assignment. We either
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment