Skip to content

patters-match/zx-basic-syntax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

zx-basic-syntax

ZX BASIC language syntax for editing .bas files in Sublime Text 3 code editor. It also supports regular Sinclair BASIC, and zmakebas listings.

screenshot of ZX BASIC highlighting

ZX BASIC is an updated BASIC dialect which compiles to optimised Z80 machine code for the ZX Spectrum computer. The Sublime Text editor, like the ZX BASIC compiler, runs on Linux, Mac OS, and Windows.

This syntax highlighter does not exhaustively match all BASIC keywords, rather its focus is code clarity. Mariana colour scheme (pictured) is recommended over the default Monokai, since some highlights are invisible in Monokai.

Highlighting Scope:

  • Line numbers, and labels which replace them
  • Comment lines, comment blocks
  • Strings including all ZX BASIC escaped characters and zmakebas escaped characters
  • To avoid over-colouring, keywords are limited to conditionals and those controlling execution flow
  • Sub and Function definitions and calls, although their calls are indistinguishable from array references (and strings without sigils) since the parser does not track objects
    Hover the mouse pointer over a Sub/Function name to jump to the function definition, and to other mentions
  • Variable types, numbers, separators, operator symbols, and compiler keywords
  • Inline Z80 assembly language, via a dependency on https://github.com/mrcook/Z80Assembly

Instructions:

About

ZX BASIC language syntax for editing .bas files in Sublime Text 3

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors