From 6112ec2f88a7b8ebb9e9d3eef6ba2558ec1df2f3 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Sat, 4 Jan 2025 07:46:30 -0500 Subject: [PATCH] Add new types and date constant regex This change adds support for the new Date and Byte type. --- dhall-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dhall-mode.el b/dhall-mode.el index c4ea765..9cb1e12 100644 --- a/dhall-mode.el +++ b/dhall-mode.el @@ -85,7 +85,7 @@ (defvar dhall-mode-keywords (regexp-opt '("if" "then" "else" "let" "in" "using" "as") 'symbols)) (defvar dhall-mode-types - (regexp-opt '("Optional" "Bool" "Natural" "Integer" "Double" "Text" "List" "Type") 'symbols)) + (regexp-opt '("Optional" "Bool" "Natural" "Integer" "Double" "Text" "List" "Type" "Date" "Time" "TimeZone" "Bytes") 'symbols)) (defconst dhall-mode-constants (regexp-opt '("True" "False") 'symbols)) (defconst dhall-mode-numerals "\\_<[+\\-][1-9]+\\_>") @@ -94,6 +94,7 @@ (defconst dhall-mode-variables "\\([a-zA-Z_][a-zA-Z_0-9\\-]*\\)[[:space:]]*=") (defconst dhall-mode-urls "\\_<\\(?:https?\\|file\\):[^[:space:]]+") (defconst dhall-mode-shas "\\_") +(defconst dhall-mode-date "[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9]") (defconst dhall-mode-font-lock-keywords `( ;; Variables @@ -104,6 +105,7 @@ (,dhall-mode-operators . font-lock-builtin-face) (,dhall-mode-variables . (1 font-lock-variable-name-face)) (,dhall-mode-keywords . font-lock-keyword-face) + (,dhall-mode-date . font-lock-constant-face) (,dhall-mode-doubles . font-lock-constant-face) (,dhall-mode-numerals . font-lock-constant-face)))