Skip to content

Commit

Permalink
feat: add delimiters highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyure-A committed Mar 16, 2024
1 parent 2e14cb9 commit e0f2bea
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions satysfi-ts-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,31 @@
"@import:")
"List of includes used in the text of SATySFi.")

(defvar satysfi-ts-mode--delimiters
'(";"
":"
","
"#")
"List of delimiters used in the text of SATySFi.")

;; see https://github.com/monaqa/tree-sitter-satysfi/blob/master/queries/highlights.scm
(defvar satysfi-ts-mode--font-lock-settings
(treesit-font-lock-rules
:language 'satysfi
:feature 'bracket
'([,@satysfi-ts-mode--brackets] @font-lock-bracket-face
(block_text ["<" "'<"] @font-lock-bracket-face ">" @font-lock-bracket-face)
[";" ":" "," (inline_text_bullet_star) "#" ] @font-lock-bracket-face)
(block_text ["<" "'<"] @font-lock-bracket-face ">" @font-lock-bracket-face))

:language 'satysfi
:feature 'comment
'((comment) @font-lock-comment-face)

:language 'satysfi
:feature 'delimiter
'([,@satysfi-ts-mode--delimiters (inline_text_bullet_star)] @font-lock-delimiter-face
(inline_text_list "|" @font-lock-delimiter-face)
(math_list "|" @font-lock-delimiter-face))

:language 'satysfi
:feature 'escape
'((inline_literal_escaped) @font-lock-escape-face)
Expand Down

0 comments on commit e0f2bea

Please sign in to comment.