super-continent/bbscript

Arg system rewrite

Closed this issue · 1 comments

the argument system in BBScript currently works reasonably well, but there are a couple major issues with it that can be fixed. most notably there is the fact that named values are per-instruction, and not an easily modifiable global "enum" system.

current idea for making this global enum system is to use a per-game hashmap where each string corresponds to an inner bidirectional hashmap containing named values and their actual values, something like this:

(
  named_values: {
    "NEW_ENUM_TYPE" : {
      "VALUE_1" : 1,
    }
  },
  functions: [
          (
            id: 1,
            size: 12,
            args: [ Map("NEW_ENUM_TYPE"), i32, ],
            name: "exampleInstruction",
            codeBlock: NoBlock,
        ),
    // etc...
  ]
)

Closed with 1.0 :)