SkyTemple / ExplorerScript

ExplorerScript and SSBScript: Script languages for decompiled SSB (Pokémon Mystery Dungeon Explorers of Sky)
MIT License
16 stars 6 forks source link

Allow @ as prefix for label definitions #52

Closed theCapypara closed 1 month ago

theCapypara commented 2 months ago

Summary

Allow @ as a prefix for label definitions instead of just §. Deprecate the old syntax.

Motivation

QWERTY keyboards have no @.

Examples

def 0 {
   @label1;
   jump @label1;
}

This would now be a valid label definition and jump to it.

def 0 {
   §label1;
   jump @label1;
}

Equivalent definition and jump with current syntax.

Language Changes

Parser and Lexer Changes

The parser must accept AT as an alternative to PARAGRAPH for label.

Behaviour

None. Labels would have the same name, regardless of prefix (@label1 and §label1 are the same label), this would be purely on parser level.

Compiler Implementation

Compiler Interface Changes

None.

Decompiler Changes

Decompile labels with the new syntax.

How to teach

Update this in the documentation. Add a note that "§" is also allowed historically but deprecated.

Alternatives

Backwards compatibility

The old syntax still works, but is now deprecated.