hex0punk / wally

Function callpath mapping analysis tool for Go
Mozilla Public License 2.0
28 stars 0 forks source link

Parse and Resolve arguments of type BasicLit + Const #2

Closed hex0punk closed 11 months ago

hex0punk commented 11 months ago

There are times a parameter used to pass a method of path for an HTTP handler looks like this:

basePath + "/query"

Where basePath is a constant. I believe in the AST this would translate to a ast.BinaryExpr expression. From there there, we'd get a X, Y, and Op elements. Op would be the operator, which would have to be + and X, this example, would be a constant and Y a basic literal. The idea is to extract both values and add them together when resolving the path argument of a function.

hex0punk commented 11 months ago

Solved by PR#3