Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
nine jnthn: is there a plan for how to get file name and line number information into files compiled from RakuAST? I kinda miss that when debugging things... 09:54
jnthn nine: Yes, my idea was that every RakuAST node carries a signed integer that is the char offset of the element in "normal" mode, but if there is more detailed match info to attach (for example, if we want to provide a parse mode that gives the exact extends of everything) negative integers are used, and negated and used as a lookup in a table, perhaps attached to the comp unit. 14:06
The same table approach would also be used for macros, where the AST instantiated from the quasi might correspond to source from another file 14:07
nine: For passing it on to the QAST, I think it'd work a lot like today: resolve the char offset into a line number and attach it for each statement
The existing char offset to line conversinon thing somewhere in NQP can presumably be reused, along with its caching 14:08
Ah, and also: I figured the char offset would be attached in the `attach` method: github.com/rakudo/rakudo/blob/46d8...ns.nqp#L22 14:10
nine And that would call a new set-char-offset (or the like) method on RakuAST::Node, so we don't have to adjust all the constructors? 14:25
jnthn Yes, something like that 15:04
nine jnthn: don't remember if I've asked this before, but have you actually ever looked at my rakuast commits? 16:15