## Prog8 syntax ## Created by Adiee5 ## If issues encountered, make an issue on prog8 github page and ping @Adiee5 ## Licensed under GPL v3 syntax prog8 "\.p8$" comment ";" # Index thing and Array literals ##color teal "\[[^]]*\]" color teal "\]" color teal "\[" # Struct definitions and pointers color crimson "struct[[:blank:]]+[[:alpha:]][[:alnum:]_]*" color crimson "enum[[:blank:]]+[[:alpha:]][[:alnum:]_]*" color crimson "\^\^[[:blank:]]*[[:alpha:]][[:alnum:]_.]*" # Scope Parents color latte "[[:alpha:]][[:alnum:]_]*\." # function color brightyellow "[[:alpha:]][[:alnum:]_]*[[:blank:]]*\(" # Key Words color lightgreen "\<(true|if_cs|if_eq|if_mi|if_vs|if_z|if_neg)\>" color lightred "\<(false|if_cc|if_ne|if_pl|if_vc|if_nz|if_pos)\>" color red "\|_)" color red "\<(sub|(inline[[:space:]]+)?asmsub|extsub|else|then|void|not|and|or|xor|for|in|(down)?to|return|while|repeat|break|continue|step|goto|when|as|const|do|until|unroll|struct|clobbers|on|private|public|alias|swap|call|sizeof|defer)\>" # Labels color sky "^[[:alpha:]][[:alnum:]_]*:" # Data Types color crimson "\<(u?byte|u?word|str|bool|float|long|pointer)\>" # Brackets color yellow "[()]" # @ color brightmagenta "@[[:blank:]]*[[:alnum:]_]*" # & and ^^ color brick "&|\^\^" # Arrows color lagoon "->" # Encoding color cyan "[[:alnum:]_]+:["']" # char literal color brightcyan "'([^\\]|\\([^ux]|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{2}))'" # %asm handling color normal start="%[Aa][Ss][Mm]" end="}}" color magenta "%[Aa][Sm][Mm]" # Directives color magenta "^[[:space:]]*%[[:alpha:]]+" # Built-in functions color white "\<(abs|call|callfar|callfar2|clamp|cmp|divmod|len|lsb|lsw|lmh|memory|mkword|mklong|mklong2|min|max|msb|msw|offsetof|peek|peekw|peekp|peekl|peekf|peekbool|poke|pokew|pokep|pokel|pokef|pokebool|pokebowl|pokemon|pop|popw|popl|popf|popp|psg|psg2|push|pushw|pushl|pushf|pushp|rsave|rrestore|rol|rol2|ror|ror2|set_carry|set_irqd|clear_carry|clear_irqd|setlsb|setmsb|sgn|sizeof|sqrt)\>" # Strings color brightblue ""([^"]|\\")*"" # Comments color green ";.*" color green start="/\*" end="\*/" # Trailing Whitespace color ,green "[[:space:]]+$"