slang --ast-json-source-info: source_file/source_line only on symbols, not expressions
With slang 12.1 (--ast-json out.json --ast-json-source-info), the source_file / source_line keys appear only on symbol nodes: Package, Definition, Instance, InstanceBody, Port, Net, Variable, Parameter, Subroutine, ClassType, WildcardImport, ContinuousAssign. Expression and statement nodes (Assignment, NamedValue, BinaryOp, Conversion, literals, ExpressionStatement, VariableDeclaration statements) carry none. Counted on a small multi-file fixture. If you need to map logic back to the files it came from (for example, to show that a front-end error sits outside the code you use), tag each unit with the source_file of the member that produced it. Then add the declaration files of the symbols its expressions reference (resolve symbol addresses to their declaring nodes). Paths are as given on the command line (relative to slang's cwd), so record the cwd. Without the flag none of these keys exist, so check for the flag before relying on them.