Skip to content

Commit 6d744c4

Browse files
committed
Update documentation
1 parent 8cfc32f commit 6d744c4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,33 @@ environment. That will print this for the above `add`:
924924
(full print mode also adds a `[type]` for each expression, right before the
925925
debug location).
926926

927+
The debug information is also propagated from an expression to its
928+
next sibling:
929+
```wat
930+
;;@ src.cpp:100:33
931+
(local.set $x
932+
(i32.const 0)
933+
)
934+
(local.set $y ;; This receives an annotation of src.cpp:100:33
935+
(i32.const 0)
936+
)
937+
```
938+
939+
You can prevent the propagation of debug info by explicitly mentioning
940+
that an expression has not debug info using the annotation `;;@` with
941+
nothing else:
942+
```wat
943+
;;@ src.cpp:100:33
944+
(local.set $x
945+
;;@
946+
(i32.const 0) ;; This does not receive any annotation
947+
)
948+
;;@
949+
(local.set $y ;; This does not receive any annotation
950+
(i32.const 0)
951+
)
952+
```
953+
927954
There is no shorthand in the binary format. That is, roundtripping (writing and
928955
reading) through a binary + source map should not change which expressions have
929956
debug info on them or the contents of that info.

0 commit comments

Comments
 (0)