File: bat.lang

package info (click to toggle)
highlight 4.10-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,556 kB
  • sloc: cpp: 27,579; makefile: 411; sh: 341; ansic: 264; php: 236; python: 217; ruby: 132; perl: 61; tcl: 1
file content (63 lines) | stat: -rw-r--r-- 2,192 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

Description="MS DOS Batch"

Categories = {"source", "script"}

Keywords={
  { Id=1,
    List={"do", "else", "end", "errorlevel", "exist", "exit", "for", "goto", "if", "not",
          "pause", "return", "say", "select", "then", "neq", "when"},
  },
  { Id=2,
    List={
      "ansi", "append", "assign", "attrib", "autofail", "backup", "basedev",
      "boot", "break", "buffers", "cache", "call", "cd", "chcp", "chdir", "chkdsk",
      "choice", "cls", "cmd", "codepage", "command", "comp", "copy", "country",
      "date", "ddinstal", "debug", "del", "detach", "device", "devicehigh", "devinfo",
      "dir", "diskcoache", "diskcomp", "diskcopy", "doskey", "dpath", "dumpprocess",
      "eautil", "endlocal", "erase", "exit_vdm", "extproc", "fcbs", "fdisk",
      "fdiskpm", "files", "find", "format", "fsaccess", "fsfilter", "graftabl",
      "iopl", "join", "keyb", "keys", "label", "lastdrive", "libpath", "lh",
      "loadhigh", "makeini", "maxwait", "md", "mem", "memman", "mkdir", "mode",
      "move", "net", "patch", "path", "pauseonerror", "picview", "pmrexx", "print",
      "printmonbufsize", "priority", "priority_disk_io", "prompt", "protectonly",
      "protshell", "pstat", "rd", "recover", "reipl", "ren", "rename", "replace",
      "restore", "rmdir", "rmsize", "run", "set", "setboot", "setlocal", "shell",
      "shift", "sort", "spool", "start",
      "subst", "suppresspopups", "swappath", "syslevel", "syslog", "threads", "time",
      "timeslice", "trace", "tracebuf", "tracefmt", "trapdump", "tree", "type",
      "undelete", "unpack", "use", "ver", "verify", "view", "vmdisk", "vol", "xcopy",
      "xcopy32", "xdfcopy", "echo"},
  },
  { Id=3,
    Regex=[[%\w+%]],
  },
  { Id=4,
    Regex=[[:\w+]],
  },
}

Strings={
  Delimiter=[["|']],
  Interpolation=[[ %\w+% ]],
}

IgnoreCase=true

Comments={
  { Block=false,
    Delimiter= { [[^(rem|Rem|REM).*]] },
  },
}

Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\:|\&|<|>|\!|\=|\/|\*|\%|\+|\-]]

-- fix recognition of $
function OnStateChange(oldState, newState, token)

  if string.match(token, "%%.*%%") ~= nil and oldState==HL_STRING and newState==HL_KEYWORD then
    return HL_INTERPOLATION
  end

  return newState
end