Last active
September 28, 2020 19:04
-
-
Save porglezomp/690bb0f75883dc69350174b576ad643f to your computer and use it in GitHub Desktop.
A vim syntax definition for HOVALAAG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: HOVALAAG Assembly | |
" Maintainer: Cassie Jones | |
" Latest Revision: 20 September 2020 | |
" See the game at http://silverspaceship.com/hovalaag/ | |
" Get updates at https://gist.github.com/porglezomp/690bb0f75883dc69350174b576ad643f | |
syntax case ignore | |
syn match vasmOperator "[+->|&^~]" | |
syn match Number "-\?\([0-9]\+\|\$[0-9A-F]\+\)" | |
syn match vasmIdentifier "\<\([ABCDFW]\|IN[12]\|OUT[12]\)\>" | |
syn match vasmDestination "\<\([ABCDFW]\|IN[12]\|OUT[12]\)\>=\@=" | |
syn match vasmFunction "\<\(ZERO\|NEG\|POS\|DEC\)\>" | |
syn match vasmOperator "\<DEC\>" | |
syn match vasmOperator "\<\(JMP[TF]\?\|DECNZ\)\>" skipwhite nextgroup=vasmLabelExpr | |
syn match vasmLabelExpr "[a-z_][a-z0-9_]*" contained | |
syn match vasmLabel "^[^[:space:]]\+:\@=" | |
syn match vasmError "^[^[:space:]][^:]*$" | |
syn match vasmError "D=[^A][^,]*" | |
syn match vasmError "[AC]=A([^-+&|^>]|$)" | |
syn match vasmPortError "\(\(IN\|OUT\)1\)\([^;]*\(IN\|OUT\)2\)\@=" | |
syn match vasmPortError "\(\(IN\|OUT\)2\)\([^;]*\(IN\|OUT\)1\)\@=" | |
syn match vasmPortError "\(\(IN\|OUT\)1[^;]*\)\@<=\(\(IN\|OUT\)2\)" | |
syn match vasmPortError "\(\(IN\|OUT\)2[^;]*\)\@<=\(\(IN\|OUT\)1\)" | |
syn match vasmNumberError "\([BW]=\)\@<!-\?\([0-9]\+\|\$[0-9A-F]\+\)" | |
syn match Number "\(>>\)\@<=1" | |
syn match Number "0" | |
syn match Comment ";.*$" | |
hi def link vasmIdentifier Identifier | |
hi def link vasmDestination Type | |
hi def link vasmKeyword Keyword | |
hi def link vasmOperator Operator | |
hi def link vasmFunction Function | |
hi def link vasmLabelExpr Special | |
hi def link vasmLabel Special | |
hi def link vasmPortError Error | |
hi def link vasmError Error | |
hi def link vasmNumberError Error |
Thanks, I'll incorporate that change.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for making this!
Error on [AC]=A seems too strict. You can do C=A+B for example right? I changed it to this:
syn match vasmError "[AC]=A([^-+&|^>]|$)"