You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mlugg I started to fix this to underline the right part of the source, but then I noticed that you've managed to get things set up nicely where LowerZon doesn't directly access the AST anymore.
Would it cause any problems for me to cause getTree on error in order to determine the correct error location here?
@MasonRemaley Rather than using getTree... situations like this are exactly what LazySrcLoc is made to deal with! The idea is that you create a LazySrcLoc which represents the location you're trying to actually point to, without actually doing the work of computing it. That work is deferred for later.
In this case, what you want is a LazySrcLoc with .offset = .{ .node_offset_field_name_init = the_init }. That field of Offset takes the source node of the RHS of = in a struct initializer, and turns it into the span of the token to the left of = -- that is, the field name.
Zig Version
0.14.0-dev.3267+59dc15fa0
Steps to Reproduce and Observed Output
Expected Output
I expect to get this error
The text was updated successfully, but these errors were encountered: