niv / neverwinter.nim

CLI tools and nim library used in Neverwinter Nights: Enhanced Edition development
MIT License
131 stars 29 forks source link

Add support for unary plus #130

Closed tinygiant98 closed 3 months ago

tinygiant98 commented 3 months ago

This change provides support for unary plus operations for constants and variables. This allows constructs such as +7, +x, (+7 + +x), etc. The result can also be passed directly as a function paramater or used within a conditional: my_function(+x), if (+x) {}, while (+x) {}, etc.

Addresses #127 and #57.

Testing

Tested the following constructs: +<variable|constant> some_variable = +<variable|constant> my_function_call(+<variable|constant>); if (+<variable|constant>) {} while (+<variable|constant>) {} some_variable = [+]<variable|constant> <+|-> [+]<variable|constant>;

Changelog

Added

Licence