xNVSE / NVSE

New Vegas Script Extender (NVSE)
https://git.io/JfSAo
702 stars 55 forks source link

Fixed(?) parsing issue with multi-arg commands with trailing conditional operators. #195

Closed bdemmy closed 3 months ago

bdemmy commented 3 months ago

Ex: If GetINIFloatOrCreate_Cached "Edge Settings:bCharismaAffectsReputationChange" "EDGE TTW Config.ini" == 1

Would parse as: If (GetINIFloatOrCreate_Cached "Edge Settings:bCharismaAffectsReputationChange") ("EDGE TTW Config.ini" == 1)

Now parses as: If (GetINIFloatOrCreate_Cached "Edge Settings:bCharismaAffectsReputationChange" "EDGE TTW Config.ini") == 1

Ref: https://discordapp.com/channels/711228477382328331/968169786414596126/1186750916699889815

Unit tests all passing, as well as original bug case.

There may be a better way of fixing this. Please let me know as I would like to improve/contribute more to xNVSE.

lStewieAl commented 3 months ago

Please add a unit test for your changes, see NVSE/unit_tests folder for some examples. The test should fail when ran on xNVSE before your PR and pass with your changes.

bdemmy commented 3 months ago

Please add a unit test for your changes, see NVSE/unit_tests folder for some examples. The test should fail when ran on xNVSE before your PR and pass with your changes.

Done: it is very basic but I think it should be enough combined with the rest of the suite.

bdemmy commented 3 months ago

I am working on another commit for this, I don't actually think some of what I did is necessary

bdemmy commented 3 months ago

Should be good now.

korri123 commented 3 months ago

This looks good to me, nice PR