diff options
author | Christian Hergert <christian@hergert.me> | 2022-07-26 20:37:14 +0000 |
---|---|---|
committer | Christian Hergert <christian@hergert.me> | 2022-07-26 20:37:14 +0000 |
commit | e40e027f955cd9d84adce277cd1a247805fd57dc (patch) | |
tree | b4fc3ee319cd77d67049747cbf17770687a7887e | |
parent | 9e7d80c4099120a47707299aafe7d59400cb3daa (diff) | |
parent | b9c6b330192270882677fe622498b3a875a33357 (diff) | |
download | gtksourceview-e40e027f955cd9d84adce277cd1a247805fd57dc.tar.gz |
Merge branch 'lean-identifiers' into 'master'
lean.lang: fix highlighting of identifiers
See merge request GNOME/gtksourceview!275
-rw-r--r-- | data/language-specs/lean.lang | 13 | ||||
-rw-r--r-- | tests/syntax-highlighting/file.lean | 6 |
2 files changed, 15 insertions, 4 deletions
diff --git a/data/language-specs/lean.lang b/data/language-specs/lean.lang index 2cb0e051..8dac67d9 100644 --- a/data/language-specs/lean.lang +++ b/data/language-specs/lean.lang @@ -4,7 +4,7 @@ This file is part of GtkSourceView Authors: Elias Aebi - Copyright (C) 2021 Elias Aebi + Copyright (C) 2021-2022 Elias Aebi GtkSourceView is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,7 @@ <style id="comment" name="Comment" map-to="def:comment"/> <style id="command" name="Command" map-to="def:preprocessor"/> <style id="keyword" name="Keyword" map-to="def:keyword"/> + <style id="identifier" name="Identifier"/> <style id="string" name="String" map-to="def:string"/> <style id="character" name="Character" map-to="def:character"/> <style id="escaped-character" name="Escaped Character" map-to="def:special-char"/> @@ -89,6 +90,7 @@ <keyword>mut</keyword> <keyword>namespace</keyword> <keyword>open</keyword> + <keyword>partial</keyword> <keyword>return</keyword> <keyword>section</keyword> <keyword>structure</keyword> @@ -101,6 +103,14 @@ <keyword>λ</keyword> </context> + <context id="identifier" style-ref="identifier"> + <match extended="true"> + (?![λΠΣ])[a-zA-Zα-ωΑ-Ωἀ-῾ϊ-ϻ℀-⅏_] + (?:(?![λΠΣ])[a-zA-Zα-ωΑ-Ωἀ-῾ϊ-ϻ℀-⅏_0-9'ⁿ₀-₉ₐ-ₜᵢ-ᵪ])* + | «[^«»\r\n\t]*» + </match> + </context> + <define-regex id="string-escape" extended="true"> \\( \\ @@ -152,6 +162,7 @@ <context ref="block-comment"/> <context ref="command"/> <context ref="keyword"/> + <context ref="identifier"/> <context ref="string"/> <context ref="character"/> <context ref="numeric"/> diff --git a/tests/syntax-highlighting/file.lean b/tests/syntax-highlighting/file.lean index 5b92b00a..13df9a11 100644 --- a/tests/syntax-highlighting/file.lean +++ b/tests/syntax-highlighting/file.lean @@ -7,9 +7,9 @@ def main : IO Unit := let a := 1 - let b := 0b1 - let c := 0x1 - let d := '1' + let a1 := 0b1 + let a₂ := 0x1 + let a' := '1' IO.println "Hello World" #eval main |