Skip to content

Commit 6112ec2

Browse files
Add new types and date constant regex
This change adds support for the new Date and Byte type.
1 parent 87ab69f commit 6112ec2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dhall-mode.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
(defvar dhall-mode-keywords (regexp-opt '("if" "then" "else" "let" "in" "using" "as") 'symbols))
8686

8787
(defvar dhall-mode-types
88-
(regexp-opt '("Optional" "Bool" "Natural" "Integer" "Double" "Text" "List" "Type") 'symbols))
88+
(regexp-opt '("Optional" "Bool" "Natural" "Integer" "Double" "Text" "List" "Type" "Date" "Time" "TimeZone" "Bytes") 'symbols))
8989

9090
(defconst dhall-mode-constants (regexp-opt '("True" "False") 'symbols))
9191
(defconst dhall-mode-numerals "\\_<[+\\-][1-9]+\\_>")
@@ -94,6 +94,7 @@
9494
(defconst dhall-mode-variables "\\([a-zA-Z_][a-zA-Z_0-9\\-]*\\)[[:space:]]*=")
9595
(defconst dhall-mode-urls "\\_<\\(?:https?\\|file\\):[^[:space:]]+")
9696
(defconst dhall-mode-shas "\\_<sha256:[a-f0-9]+\\_>")
97+
(defconst dhall-mode-date "[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9]")
9798

9899
(defconst dhall-mode-font-lock-keywords
99100
`( ;; Variables
@@ -104,6 +105,7 @@
104105
(,dhall-mode-operators . font-lock-builtin-face)
105106
(,dhall-mode-variables . (1 font-lock-variable-name-face))
106107
(,dhall-mode-keywords . font-lock-keyword-face)
108+
(,dhall-mode-date . font-lock-constant-face)
107109
(,dhall-mode-doubles . font-lock-constant-face)
108110
(,dhall-mode-numerals . font-lock-constant-face)))
109111

0 commit comments

Comments
 (0)