rascal 0.3.4

A parser and compiler for Flash ActionScript 2 files into SWFs
Documentation
---
source: crates/rascal/src/tests.rs
expression: result
input_file: samples/as2/function_hoisting.as
---
initializer:
  actions:
    - ConstantPool:
        - function within a function!
        - first function!
        - functionWithinAFunction
        - "firstVar = "
        - firstVar
        - ", secondVar = "
        - secondVar
        - second function!
        - second function! (but redefined!)
        - third function!
        - Unused function!
        - firstFunction
        - secondFunction
        - thirdFunction
    - DefineFunction:
        name: firstFunction
        params: []
        actions:
          actions:
            - DefineFunction:
                name: functionWithinAFunction
                params: []
                actions:
                  actions:
                    - Push:
                        - Constant: 0
                    - Trace
                  label_positions: {}
            - Push:
                - Constant: 1
            - Trace
            - Push:
                - Integer: 0
                - Constant: 2
            - CallFunction
            - Pop
            - Push:
                - Constant: 3
                - Constant: 4
            - GetVariable
            - Add2
            - Push:
                - Constant: 5
            - Add2
            - Push:
                - Constant: 6
            - GetVariable
            - Add2
            - Trace
          label_positions: {}
    - DefineFunction:
        name: secondFunction
        params: []
        actions:
          actions:
            - Push:
                - Constant: 7
            - Trace
            - Push:
                - Constant: 3
                - Constant: 4
            - GetVariable
            - Add2
            - Push:
                - Constant: 5
            - Add2
            - Push:
                - Constant: 6
            - GetVariable
            - Add2
            - Trace
          label_positions: {}
    - DefineFunction:
        name: secondFunction
        params: []
        actions:
          actions:
            - Push:
                - Constant: 8
            - Trace
            - Push:
                - Constant: 3
                - Constant: 4
            - GetVariable
            - Add2
            - Push:
                - Constant: 5
            - Add2
            - Push:
                - Constant: 6
            - GetVariable
            - Add2
            - Trace
          label_positions: {}
    - DefineFunction:
        name: thirdFunction
        params: []
        actions:
          actions:
            - Push:
                - Constant: 9
            - Trace
          label_positions: {}
    - DefineFunction:
        name: unusedFunction
        params: []
        actions:
          actions:
            - Push:
                - Constant: 10
            - Trace
          label_positions: {}
    - Push:
        - Constant: 4
        - Integer: 1
    - DefineLocal
    - Push:
        - Integer: 0
        - Constant: 11
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 12
    - CallFunction
    - Pop
    - Push:
        - Constant: 6
        - Integer: 2
    - DefineLocal
    - Push:
        - Integer: 0
        - Constant: 11
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 12
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 11
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 12
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 11
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 12
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 2
    - CallFunction
    - Pop
    - Push:
        - Integer: 0
        - Constant: 13
    - CallFunction
    - Pop
  label_positions: {}
extra_modules: []
compile_options:
  swf_version: 15
  optimizations:
    fold_constants: true
    promote_variables_to_registers: true
custom_pcodes: []