caiosm1005 / bcce

ACS compiler
MIT License
1 stars 0 forks source link

int and fixed types #4

Open caiosm1005 opened 9 years ago

caiosm1005 commented 9 years ago

Differentiate integer numbers from fixed numbers in ACS.

This way we can easily convert these literals back and forth in the compiler, ultimately allowing to deprecate FixedDiv, FixedMul and other horrible ACS contraptions.

  1. Create new literal type fixed
  2. Implicit conversion:
    1. in binary operations;
    2. when working with switches;
    3. when assigning a fixed number to an integer variable and vice-versa
  3. Review functions in std.acs; change values from int to fixed where necessary
caiosm1005 commented 9 years ago

Some std functions can be "overloaded", e.g.:

CheckActorProperty(0, APROP_1, 15);
CheckActorProperty(0, APROP_2, 3.1415);
CheckActorProperty(0, APROP_3, "A string!");

Must come up with a solution for this scenario.