slackhq / tree-sitter-hack

Hack grammar for tree-sitter
MIT License
33 stars 15 forks source link

Add ret debugging macro #24

Closed aosq closed 3 years ago

aosq commented 3 years ago

Summary

I originally added the set macro to see when a symbol was matched in a scan. With the scan_delimiter (previously scan_end) no longer setting a result_symbol, it's hard to know what exactly that function does or returns during debugging.

We add the ret macro to be called for function returns so that we can clearly see when we enter and exit a function. See the example output included as a comment in src/scanner.cc.

Requirements (place an x in each [ ])