Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uninit, true, false keywords to grammar #596

Merged
merged 33 commits into from Jan 20, 2024
Merged

Conversation

KevinEady
Copy link
Contributor

@KevinEady KevinEady commented Jan 11, 2024

TODO for true and false:

  • implementation
  • tests
  • docs (escript guide)
  • core-changes

TODO for uninit, true, false:

  • optimizer

@coveralls
Copy link
Collaborator

coveralls commented Jan 11, 2024

Coverage Status

coverage: 47.163% (+0.2%) from 46.984%
when pulling 152f5db on add-uninit-keyword
into 76316e4 on master.

@KevinEady KevinEady marked this pull request as draft January 11, 2024 07:39
@KevinEady KevinEady marked this pull request as ready for review January 11, 2024 11:22
@KevinEady KevinEady marked this pull request as draft January 11, 2024 12:59
@KevinEady KevinEady changed the title Add uninit keyword to grammar for uninitialized object Add uninit, true, false keywords to grammar for uninitialized object Jan 11, 2024
@KevinEady KevinEady marked this pull request as ready for review January 12, 2024 13:33
@turleypol
Copy link
Member

Some thoughts:
Add a test if const blubb:= works for bool and uninit
Do we need a BinaryOptimizerWithBoolean and visit_boolean_value for the integers? (No clue)
Does it mean that
Switch (true)
true: false:
EndSwitch
Works? (Also no clue if desired;) )

@KevinEady KevinEady marked this pull request as draft January 13, 2024 18:03
@KevinEady
Copy link
Contributor Author

Will delay this merge until new POL release completed, moved to draft

@KevinEady KevinEady marked this pull request as ready for review January 18, 2024 14:09
@KevinEady KevinEady changed the title Add uninit, true, false keywords to grammar for uninitialized object Add uninit, true, false keywords to grammar Jan 18, 2024
@KevinEady KevinEady enabled auto-merge (squash) January 18, 2024 14:40
@KevinEady KevinEady merged commit 593cfff into master Jan 20, 2024
68 checks passed
@KevinEady KevinEady deleted the add-uninit-keyword branch January 20, 2024 04:38
KevinEady added a commit that referenced this pull request Jan 20, 2024
* Update maximum animation ID in configuration (#588)

* Update maximum animation ID in configuration

* updated core-changes

* Change author name in corechanges.xml and
core-changes.txt

* updated pol.cfg docs

* fix stylecheck test

* removed useless comment

* Added MaxAnimID to pol.cfg.example

* New Kaitai version (#589)

* updated Kaitai version, use shipped CMakeList.
Added imported library target for easier integration

* replaced debug CMakeList with original

* Add support for boat piloting via mouse movement (#558)

* Initial work on boat piloting changes
- Changed: Boat script is now registered as the boat's control script
- Added: Boat piloting via mouse movement
- Added: boatRef.pilot member
- Added: boatRef.pilot([charRef]) method

* add first test

* Fix boat control script attach on scripted create

* move boat move packet warnings to suspicious acts

* set pilot now errors when mutli has no process

* Add test, testclient support for boat move packet

* Touchup pilot members and methods
- Change `pilot` method to `setpilot`. This standarizes it a bit with
the same naming convention of `npc.setmaster`.
- Fix return values in `pilot` member, returning `0` if no pilot.

* Refactor to put functionality inside UBoat

* Address Discord comments
- Remove SuspecisionActs for no boat process.
- Add `relative_direction` to boat move sysevent.

* destroy boatmount on chr death; more error checks

* Fix compilation after master merge

* Fix relative_direction calculation

* wip tests

* Fix boat tests

* Address review comments
- Initialize UBoat::mountpiece

* Add HSA check to boat.setpilot

* Reject movement if boat mountpiece equipped

* docs; test cleanup

* add test for blocked movement

* Address Discord review comments
- Add suspicious acts notice for client movement while piloting
- Return error on attempting to script move a char that is piloting a boat

* Fix compiler warning

* adapted gitignore for new kaitai (#590)

* Allow custom boat control script defined in boat item descriptor; Rename boat method `setpilot` to `set_pilot` (#591)

* Allow custom boat control script defined in boat item descriptor

* Rename boat.setpilot to boat.set_pilot

* Add `boat.set_alternate_multiid` (#593)

* Fix unhandled exception in UBoat::create_component

* Return 0 on unsuccessful boat move with MoveBoat and MoveBoatRelative

* Add boat.set_alternate_multiid

* skip base multiid in alternates boat struct

* Add test for boat.set_alternate_id

* docs, core-changes

* use array equals in test

* New format lib version (#592)

* renamed include guard to be able to use both format lib versions in
parallel

* build Fmt lib and link it into clib

* use std::string instead of format Writer for logging
added variant "2" for logging with new fmt lib

* use new logging variant for two logs

* always add \n to flush log, lets see if the assumption holds

* use new lib for tostring

* replaced all INFO_PRINTS in clib

* formatter for Token, BObject and BObjectImp

* started with bsccript

* use function instead of actual object for logging

* remaining bscript, started plib

* logvariant without newline added, more template magic

* format support for base types, added test for format padding
new version for fdump

* chanhed ecompile/runecl fixed compilation with ESCRIPT_PROFILE

* rewrite INFO_PRINT in plib,poltool/uoconvert/uotool

* replaced remaining INFO_PRINTS, renamed macros INFO_PRINT for logging
without newline, INFO_PRINTLN for newline addition.
Replaced also INFO_PRINT_TRACE and renamed it to INFO_PRINTLN_TRACE

* gitignore for fmt lib

* cleanup vim leftovers

* use new formatter for ERROR_PRINT, added ERROR_PRINTLN (#595)

* use new formatter for ERROR_PRINT, added ERROR_PRINTLN

* remove old log define

* fix comments

* Character buffs (#587)

* Buffs: should be now possible to set for the first cliloc arguments,
added chr.buffs member to return the current buffs

* added test

* docs

* more docs

* LEAKLOG, DEBUGLOG, SCRIPTLOG, FLEXLOG changed to new logging (#597)

* LEAKLOG, DEBUGLOG, SCRIPTLOG changed to new logging

* updated FLEXLOG

* POLLOG* macros use the new formatting (#598)

* POLLOG* macros use the new formatting
removed all old logging functions

* removed old fmt lib from everything except StreamWriter
removed unneeded functions

* fixed review comments

* Prevent sending name on singleclick on hidden character (#599)

* prevent sending name on singleclick on hidden character

* Add core-changes

---------

Co-authored-by: Kevin Eady <8634912+KevinEady@users.noreply.github.com>

* Release POL 100.1.0 (#600)

* Version bump to start work on v100.2.0 (#602)

* Add `uninit`, `true`, `false` keywords to grammar (#596)

* Update grammar

* Update expression handling for uninit

* update existing tests

* Add new tests

* Remove fullpath from escriptgrammar generation comment

* fix tests

* Update eScript guide

* Declare escript version 0x11

* Add core-changes

* Add `true` and `false` to grammar

* true/false implementation

* Fix existing tests

* Add new tests

* Update core changes

* add docs

* Fix BooleanValue::describe_to

* bool optimizations

* optimize uninit

* remove unused var assignments

* Update grammar for case labels for uninit, booleans

* Fix case label handling for uninit, true, false

* Tests

* Fix compiler version display v1.1700000017881393 -> v1.17

* optimize boolean binary operations

* fix unary boolean optimizer

* add boolean, uninit optimizer test

* Use new fmt lib apis

* Fix compiler warning

* really fix warning lol

* Add Executor[Module]::getParam for bools, FindSubstance test

* Fix PCH compilation

---------

Co-authored-by: Vitor Lima <vitor@ferreiradelima.com>
Co-authored-by: turleypol <turley@polserver.com>
Co-authored-by: Lukáš Novotný <lukas@algorim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants