The first open source version of the compiler.
There have been a number of changes since the initial Public Snapshot 1 release, some of which are breaking changes.
For help or questions join our discord.
Breaking changes
Trigger types renamed
trigger_45 -> updateobjstack
trigger_78 -> onclickloc
trigger_79 -> onclickobj
trigger_80 -> onclicknpc
trigger_81 -> onclickplayer
graphic
and fontmetrics
types relationship
Previously assigning a graphic
to a fontmetrics
type was allowed. At some point it was figured out that this is not actually a valid conversion based on enums existing to convert between the two.
Require empty parameter list
Previously parameter lists were not required, but now if a script returns something then the parameter list must still be defined, even if it is just ()
.
// Previously allowed
[proc,some_script](int)
// Must now be
[proc,some_script]()(int)
Configuration file (neptune.toml
) changes
The excluded
property was renamed to libraries
.
Identifier token rules change
The identifier token rule has been changed to be more in line with how it is for RuneScape. This change removed the special case allowing the :
(colon) character to only appear between other non-:
characters. What this means is that a space is required after a case
value.
// Previously allowed
switch_int ($x) {
case 1: ....
}
// Must now be (note the space after the case 1)
switch_int ($x) {
case 1 : ....
}
String literals no longer allow multi-line
This was never really intended and support for multi-line strings was removed.
Features
- feat: add SWITCH_TYPE to identifier rule
- feat: omit unnecessary branches when possible
- feat: omit branch after switch when unnecessary
- feat: add dump and script debug commands
- feat: allow not supplying writer
- feat: allow null literal to have type of string by becoming "null"
- feat: allow empty lines in clientscript.sym and commands.sym
- feat: add all missing ScriptVarType
Fixes
- fix: prevent comparing strings with equality operators
- fix: type hint array initializer
- fix: check command arguments when leaving of parenthesis
- fix: disable string comparison test as it is no longer valid
- fix: calculate local variable indexes properly
- fix: prevent showing unnecessary error in unresolved case symbol
- fix: correct default returns generation
- fix: only report script ref error if it is a command
- fix: require empty parameter list when defining script return types
- fix: make identifier token more accurate to RuneScript rules
- fix: prevent new lines in string literals
- fix: correct logic for having branch instruction after switch
- fix: correct code generation for logical AND
- fix: convert characters to their CP1252 value when encoding strings
Full Changelog: cs2-0.0.1-PUBLIC-SNAPSHOT1...cs2-1.0.0