comment due to the parsing, order can be important (eg, notrace before not and trace) fileTypes applesoft name Applesoft patterns match ^\d+ name entity.name.function captures 0 name keyword.function 1 name entity.name.function 2 name variable.parameter match (?i:def\s*fn)\s*([A-Za-z_][A-Za-z0-9_]*)\s*[(]\s*([A-Za-z_][A-Za-z0-9_]*)\s*[)] name meta.def.fn begin " end " name string.quoted.double match (?i:shload|load|recall|save|store) name invalid.deprecated match (?i:rem).*$ name comment.line match \d+|\d*\.\d*([eE][+-]?\d+)? name constant.numeric match (?i:goto|onerr|on|if|then|for|to|step|next|gosub|return|pop|resume|stop|del|end|wait) name keyword.control match (?i:clear|cont|del|list|new|run) name keyword.control.immediate match (?i:dim|let) name keyword.variable match (?i:poke|call|himem:|lomem:|notrace|trace) name keyword.utility comment tab/spc requires ( lookahead? match (?i:in#|input|get|read|data|restore|pr#|print|\?|text|home|htab|vtab|inverse|normal|flash|speed=|tab|spc) name keyword.io match (?i:def|fn) name keyword.function match (?i:abs|sgn|int|sqr|sin|cos|tan|atn|exp|log|rnd) name support.function.arithmetic match (?i:len|left\$|mid\$|right\$|str\$|val|chr\$|asc) name support.function.string match (?i:at|gr|color=|plot|hlin|vlin|hgr2|hgr|hcolor=|hplot|draw|xdraw|scale=|rot=) name keyword.graphics match (?i:peek|usr|fre) name support.function.utility match (?i:scrn) name support.function.graphics match (?i:pdl|pos) name support.function.io match (?i:and|or|not) name keyword.operator.logical comment uses non-greedy *? so keywords get a first shot match [A-Za-z][A-Za-z0-9]*?\s*[$%]? name variable scopeName source.applesoft uuid DEA21785-8117-41BB-9E2E-BB418E807165