aboutsummaryrefslogtreecommitdiff
path: root/language_fe.lua
blob: f97e73ba35d19eec3c7fe2579e7df438e0bdb896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local syntax = require "core.syntax"

syntax.add {
  files = "%.fe$",
  comment = ";",
  patterns = {
    { pattern = ";.-\n",              type = "comment"  },
    { pattern = { '"', '"', '\\' },   type = "string"   },
    { pattern = "0x[%da-fA-F]+",      type = "number"   },
    { pattern = "-?%d+[%d%.]*",       type = "number"   },
    { pattern = "-?%.?%d+",           type = "number"   },
    { pattern = "'",                  type = "symbol"  },
    { pattern = "%f[^(][^()'%s\"]+",  type = "function" },
    { pattern = "[^()'%s\"]+",        type = "symbol"   },
  },
  symbols = {
    ["if"]     = "keyword2",
    ["let"]    = "keyword2",
    ["do"]     = "keyword2",
    ["fn"]     = "keyword2",
    ["mac"]    = "keyword2",
    ["'"]      = "keyword2",
    ["print"]  = "keyword",
    ["while"]  = "keyword",
    ["car"]    = "keyword",
    ["cdr"]    = "keyword",
    ["not"]    = "keyword",
    ["setcdr"] = "keyword",
    ["setcar"] = "keyword",
    ["nil"]    = "literal",
    ["t"]      = "literal",
  }
}