NewProgram returns a new Program. It's used by the compiler.
( source file.Source, node ast.Node, locations []file.Location, variables int, constants []any, bytecode []Opcode, arguments []int, functions []Function, debugInfo map[string]string, span *Span, )
| 32 | |
| 33 | // NewProgram returns a new Program. It's used by the compiler. |
| 34 | func NewProgram( |
| 35 | source file.Source, |
| 36 | node ast.Node, |
| 37 | locations []file.Location, |
| 38 | variables int, |
| 39 | constants []any, |
| 40 | bytecode []Opcode, |
| 41 | arguments []int, |
| 42 | functions []Function, |
| 43 | debugInfo map[string]string, |
| 44 | span *Span, |
| 45 | ) *Program { |
| 46 | return &Program{ |
| 47 | source: source, |
| 48 | node: node, |
| 49 | locations: locations, |
| 50 | variables: variables, |
| 51 | Constants: constants, |
| 52 | Bytecode: bytecode, |
| 53 | Arguments: arguments, |
| 54 | functions: functions, |
| 55 | debugInfo: debugInfo, |
| 56 | span: span, |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // Source returns origin file.Source. |
| 61 | func (program *Program) Source() file.Source { |
no outgoing calls
searching dependent graphs…