From e5d888ae0133902e289ff855def4c874a167d21e Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Tue, 15 Mar 2022 04:40:25 +0100 Subject: [PATCH] add maude syntax --- Makefile | 5 +++ style/page.css | 11 +++++ syntax/maude.xml | 104 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 syntax/maude.xml diff --git a/Makefile b/Makefile index d08ea84..13ca4de 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,10 @@ EXECS = \ CABAL_FLAGS ?= -O -v0 +SYNTAXDIR := syntax +SYNTAXFLAGS = \ + $(patsubst %,--syntax-definition=%,$(shell find $(SYNTAXDIR) -name '*.xml')) + .PHONY: all all: build @@ -59,6 +63,7 @@ define pandoc DIRNAME="$(basename $@)" \ FILENAME="$@" \ pandoc -s --toc --template $(TEMPLATEDIR)/$(1).html -o $@ $< \ + $(SYNTAXFLAGS) \ --filter $(LANGFILTER) --filter $(NICE_DATE) --mathjax endef diff --git a/style/page.css b/style/page.css index 8c4d749..4bb6ee2 100644 --- a/style/page.css +++ b/style/page.css @@ -376,3 +376,14 @@ blockquote { padding-left: 1em; margin: auto; } + + +/* syntax highlighting for maude + * [todo] does this also look ok for other langs */ +.maude .pp { color: hsl(343deg, 100%, 40%); font-weight: 500; } +.maude .dt { color: hsl(173deg, 100%, 24%); font-weight: 500; } +.maude .fu { color: hsl(34deg, 100%, 30%); font-weight: 500; } +.maude .va { color: hsl(203deg, 100%, 30%); font-weight: 500; } +.maude .cf { color: hsl(276deg, 75%, 35%); font-weight: 500; } +.maude .op { color: hsl(220deg, 10%, 28%); } +.maude .co { color: hsl(221deg, 10%, 39%); font-style: italic; } diff --git a/syntax/maude.xml b/syntax/maude.xml new file mode 100644 index 0000000..18bc3b5 --- /dev/null +++ b/syntax/maude.xml @@ -0,0 +1,104 @@ + + + + + + + mod endm is + fmod endfm + th endth + fth endfth + view endv + from to + + + + protecting pr + including inc + extending ex + + + + sort sorts + subsort subsorts + + + op ops + var vars + eq ceq + rl crl + mb cmb + if + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +