sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
48 stars 0 forks source link

4.0.0 Release Plan #277

Closed x87 closed 1 month ago

x87 commented 11 months ago

Download

Features

Bug Fixes

Third-party

Breaking Changes

1() // gosub @1



this won't compile now. It is still possible to reference such label using @ prefix (e.g. `jump @1` or `gosub @1`)

Also disassembler checks script names (opcode 03A4) and if the name starts with a number, it prefixes all labels with an underscore (`_`). It should solve the compilation issue in the original script of Vice City Stories that has a script named '99RED'. All labels of this script now start with _99RED
x87 commented 11 months ago

Tabs Preview

https://github.com/sannybuilder/dev/assets/5698288/fb1a4740-3d83-4ec3-afb4-45532769af5b

x87 commented 10 months ago

DEV CHANGELOG

rc.0

beta.14

beta.13

Download

beta.11

beta.10

beta.9

beta.8

Download

foo(1,2,3) int z = foo(1) // both lines are accepted

> An opaque function gets a special handling in the compiler. It accepts any number of arguments and can be used with any number of outputs. Compiler does not validate anything, besides converting the call into 0AB1: cleo_call opcode

- allow custom variable declaration in SCM missions and external scripts ([#284](https://github.com/sannybuilder/dev/issues/284))
- fix a compiler error when a function name is used as an argument to another function call
- fix #322 
- #316 
- #320
- #321
- update core.dll to fix a runtime error introduced in beta.6 on Windows 7
- do not use class syntax for getters with reordered arguments when disassembling a file (only affects legacy non-SBL modes). See [SB3 Quirks](https://github.com/sannybuilder/dev/wiki/SB3-Quirks/)
- installer enables High DPI scaling for sanny.exe via Windows compatibility settings
- disable Ctrl+Alt+B/N/M hotkeys as they clash with AltGr+B/N combo for `{` and `}` on QWERTZ keyboards

### beta.7

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.7)

- (BREAKING) function pointers (variables defined with a function name as the type) now require `()` to be compiled as a function call. otherwise they are compiled as regular variables

define function myFunction myFunction f f = 0x400000 f() // () is required now

- (BREAKING) function's `end` keyword is now compiled with opcode 0051: return, not 2003: cleo_return_fail. CLEO5 is required for the `0051: return` command to support SCM functions
- (BREAKING) [new `return` semantic in functions](https://github.com/sannybuilder/dev/issues/263#issuecomment-2008124803)
- (BREAKING) function calls require `()`. Function name without `()` will be compiled as a number. For SCM functions it will be function offset (like a label), for static foreign functions it will be the address.
- (BREAKING) SCM function name prefixed with `@` is not a valid label. use function name without `@` instead
- new function return type modifier `optional` 
- new function return type `logical`
- (BREAKING) define function is not supported. Use `function` directly
- function declarations are available anywhere in the scope they are defined in (some languages call such behavior [hoisting](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions#function_hoisting))
- Shift+Backspace now works as expected in the editor
- #314 
- fix a compilation issue when an array element defined as a constant wasn't fully compiled:

const a = 1@(0@,1i) a = 1 // was compiled as 1@ = 1


### beta.6
[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.6)

- #305 
- #297 
- function name prefixed with `@` is a valid label

function foo end

cleo_call @foo

- support single `return` (opcode 0051) to exit from a function https://github.com/cleolibrary/CLEO5/pull/96
- allow string type in function arguments again, since now CLEO5 adds support for string pointers in native opcodes
- support [foreign function declarations](https://github.com/sannybuilder/dev/issues/263#issuecomment-1991556252)

### beta.5

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.5)

- basic debugger for SCM scripts ([docs](https://docs.sannybuilder.com/editor/scm-debugger), [video](https://www.youtube.com/watch?v=4-CiQZNQr18))
- increase max number of tabs restored at startup from `8` to `24`
- disable string type for arguments in function declaration #263 
- disassembler prefixes labels starting with a number with '_' to allow for callable labels syntax (e.g. `_1()`)
- custom variables can be used in `main.scm` scripts when declared and used inside `function..end`
- fix an issue blocking auto-update of SBL files if the edit mode's JSON file is corrupted
- add a link to https://tutorial.sannybuilder.com/ in Help menu
- new [Strict IF validation option](#167), disabled by default. Fixes #186 
- use of CLEO extension (via `{$USE CLEO}` or `{$CLEO}`) also enables all standard CLEO extensions (`bitwise`, `ini`, `file`, `debug`, `memory`)

### beta.4

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.4)

- fix reported issues related to functions
- fix cast assignment operator (`=#`) not working with arrays
- remove the ability to put the mouse cursor past the end of line (#253)
- update to some color themes by Vital
- improve support for functions in language service https://github.com/sannybuilder/core/issues/16
  - local variables are highlighted and listed only inside the function that declated them
  - variables types and function signatures can be viewed in autocomplete (`Ctrl+Space`)
  - functions can be annotated with `///`
  - function arguments and annotations can be seen in the arguments popup (`Ctrl+Shift+Space`)
![function-annotation](https://github.com/sannybuilder/dev/assets/5698288/c1f5e247-09b3-44ca-bb87-ac76881366bf)

### beta.3

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.3)

- fix several issues related to autocomplete
- functions can exit with the result of a single expression:

function isEvenNumber(num: int) {$use bitwise} int rem = num % 2 return rem == 0 end


### beta.2

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.2)

- disallow variable names matching class names (`car`, `char`, etc)
- allow declaring variables with the class type using the class name (`car handle`, `char myPed`)
- function syntax #263 (`function..end`)
- variables and functions declared inside function..end are scoped (not visible to outside)
- `var a: int` now mirrors `int a` behavior, previously was ignored (#289)

### beta.1

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.1)

- `switch` statement https://github.com/sannybuilder/dev/issues/160#issuecomment-1821847661
- new GTA III SBL mode
- update CustomVariables.ini in VC SBL mode (thanks @OrionSR)
- make language service aware of the new `$INCLUDE_ONCE` directive added in 3.9.0, and binary number format (`0b`)
- fix some parsing issues in GTA III with non-standard global variable and model names
- fix class autocomplete not working when variable was declared using a new inline syntax (`var $player: Player`)

### beta.0

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-beta.0)

- delete SA SCR mode (SA SBL can be used instead)
- shortcut for binary number conversion (Ctrl+B) can be redefined in options
- fix compilation issues reported from previous builds (#290)
- fix wrong variable name in sa sbl's stripped.txt
- sa sbl mode is now selected by default for the new installation
- fix default font color for the new installation
- #286

### alpha.3

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-alpha.3)

- [x] make SA SBL mode default for SA decompilation
- [x] new VC SBL mode
- [x] disassembler flips the operator in comparison opcodes, instead of using `not`:
#### before

not 0@ == 1 not 0@ > 1 not 0@ >= 1

#### now

0@ <> 1 0@ <= 1 0@ < 1


- [x] #31 
- [x] #288 
- [x] reorder edit mode list to put SBL modes on top
- [x] fix template list displaying only one word of description
- [x] path argument in the import statement can be a constant
- [x] validate operators and operands in certain kinds of expressions (i.e. assignments)
- [x] add stripped.txt in SA SBL mode
- [x] updated Portuguese translation (by @johnnie-br)

### alpha.2

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-alpha.2)

- [x] new SA SBL mode (does not use SASCM.INI)
- [x] introduce new SB3_COMPAT debug option (enabled by default) to enable some old [quirks ](https://github.com/sannybuilder/dev/wiki/SB3-Quirks/) and ease transition to the new version
  - [x] support dual syntax for setters (`Player.CanMove(0, True)` and `Player.CanMove(0) = True`) for backward compatibility 
- [x] support getter expressions with SCR/SBL modes (original param order)
   - [x] `int value = read_memory 0xDEADD0D0 4 false`
   - [x] `$x, $y, $z = Object.GetCoordinates(0@)`
- [x] support getters with multiple results `$x, $y, $z = Object.GetCoordinates(0@)`
- [x] support enums in keywords/opcode commands
    - [x] `clear_mission_audio MissionAudioSlot.Slot1`
- [x] *SCM.ini and extensions.txt are now optional, SBL JSON will be used instead

### alpha.1

[Download](https://github.com/sannybuilder/dev/releases/tag/v4.0.0-alpha.1)

- [x] fix #281 
- [x] fix #282 
- [x] fix for the compiler eating a leading ~ in string literals
- [x] fix for the new elements not seen in the Theme Editor
MatiDragon-YT commented 10 months ago

The version you passed is removing members from some classes

image

Either he is omitting them or I don't know what is going on. Why is it not appearing in the autocomplete

image

the error only disappears if the following syntax is followed.

image but I emphasize that the class member does not appear in the autocomplete.

Also now SB4 does not allow to compile classes with extra parameters written by mistake. Previously SB3 removed these extra parameters, which made the editor more user friendly.


As usual, I'm passing you the code of DYOS (the same project that always detects bugs) and the editing mode I use πŸ˜†

my edit mode: sa_cp.zip my proyect adapted to SB4: DYOS.zip

x87 commented 10 months ago

@MatiDragon-YT this is correct behavior. You define SetCollisionDetection as a prop (using ^ syntax) and require a '=' operator to be used

^SetCollisionDetection,[0619,=,1,2,0],("self: Actor" "state%b")

Compiler previously allowed two-way form of writing this command:

Actor.SetCollisionDetection(handle, false)

or

Actor.SetCollisionDetection(handle) = false

But this was a bug. Only the second form should be used.

If you want to use SetCollisionDetection as a method, use method syntax in classes.db:

SetCollisionDetection,0619,0,0,("self: Actor", "state%b")

but I emphasize that the class member does not appear in the autocomplete.

I'll take a look. It should appear

Also now SB4 does not allow to compile classes with extra parameters written by mistake. Previously SB3 removed these extra parameters, which made the editor more user friendly.

https://github.com/sannybuilder/dev/issues/150

MatiDragon-YT commented 10 months ago

But this was a bug. Only the second form should be used.

@x87 What? that was a bug? I thought it was syntactic sugar. I know it's easy to fix, but can't that be added back? well, if this is not a bug, then I have nothing to report. excellent update πŸ‘

x87 commented 10 months ago

@MatiDragon-YT use this core.dll for the autocomplete fix, should display SetCollisionDetection now core.zip

MatiDragon-YT commented 10 months ago

runing with't problem! Epic :D

x87 commented 10 months ago

But this was a bug. Only the second form should be used.

@x87 What? that was a bug? I thought it was syntactic sugar. I know it's easy to fix, but can't that be added back? well, if this is not a bug, then I have nothing to report. excellent update πŸ‘

it was added back under SB3_COMPAT debug option (enabled by default) in alpha.2. So you can still write

Actor.SetCollisionDetection(handle, false)