@word /\S+/

$(IDENT)=[A-Za-z_][A-Za-z0-9._]*

comment:
  from "#" to "\n"

class{Function}:
  from /$(IDENT)/ to ":\n"
  color{Keyword}:
    from { to }
    color.arg{Operator}:
      match /$(IDENT)/

subst{Preprocessor}:
  from /^\$\($(IDENT)\)=/

preprocessor{Preprocessor}:
  from /@(define|name|include|if|endif|declare|word|keyword)/

include{Preprocessor}:
  from "(" to ")"

command{Keyword}:
  match /(from|between|match)/
  args{Normal}:
    from here
    keyword:
      match /(to|and|here)/
    with{Preprocessor}:
      match /with\s$(IDENT)/
    arg{Normal}:
      word " "" / // /* /**
    space{Normal}:
      match /(/s|[^"/])/
    string:
      match "\""
      string.contents{String}:
        between here and /\s/
        string.subst{Preprocessor}:
          match /\$\($(IDENT)\)/
        escape:
          match /\\[fnrtv0'"\\]/
          match /\\x[0-9a-fA-F]{2}/
    regexp{Number}:
      match "/"
      regexp.contents{Number}:
        between here and /\s/
        regexp.subst{Preprocessor}:
          match /\$\($(IDENT)\)/
        regexp.escape{Escape}:
          match /\\./

word{Keyword}:
  match /(word|keyword|symbol)/
  options{Operator}:
    match /\([A-Za-z0-9,]*\)?/
    args{Normal}:
      from here
      include{Preprocessor}:
        match /@[-A-Za-z0-9.]+/
  args{Normal}:
    from here
    include{Preprocessor}:
      match /@[-A-Za-z0-9.]+/

limit{Keyword}:
  match "limit"
