Skip to content

Commit

Permalink
ending position information (#22)
Browse files Browse the repository at this point in the history
* logging metadata information of processing

1. Added stdout message to be processed by invoking utility.
2. Better error handling mechanism and subsequently logging the error
situation for given file on stout.

Note: where messages are printed with `log` it will print it to
`stderr`. `fmt.println` and its other version will print the message to
`stdout`

* ending poisition information

Added ending line number and column number information for each node.
  • Loading branch information
pandurangpatil authored Jun 27, 2023
1 parent ac326d1 commit f0ca50b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions goastgen/libgoastgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ func processStruct(node interface{}, objPtrValue reflect.Value, fset *token.File
objectMap["node_line_no"] = position.Line
objectMap["node_col_no"] = position.Column
}
if epos := astNode.End(); epos.IsValid() {
position := fset.Position(epos)
objectMap["node_line_no_end"] = position.Line
objectMap["node_col_no_end"] = position.Column
}
}
}

Expand Down

0 comments on commit f0ca50b

Please sign in to comment.