Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: syntax for verbatim string, and special char #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion syntax/idris.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ syn match idrisDirective "%\(access\|assert_total\|default\|elim\|error_reverse\
syn keyword idrisDSL lambda variable index_first index_next
syn match idrisChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'"
syn match idrisBacktick "`[A-Za-z][A-Za-z0-9_']*`"
syn region idrisString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell

syn region idrisString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell,hsSpecialChar
syn region idrisVerbatimString start=/"""/ end=/"""/ contains=@Spell fold
syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)"
syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)"

syn region idrisBlockComment start="{-" end="-}" contains=idrisBlockComment,idrisTodo,@Spell
syn region idrisProofBlock start="\(default\s\+\)\?\(proof\|tactics\) *{" end="}" contains=idrisTactic
syn match idrisIdentifier "[a-zA-Z][a-zA-z0-9_']*" contained
Expand Down Expand Up @@ -83,7 +88,12 @@ highlight def link idrisBlockComment Comment
highlight def link idrisTodo Todo
highlight def link idrisMetaVar Macro
highlight def link idrisString String
highlight def link idrisVerbatimString String
highlight def link idrisChar String
highlight def link idrisBacktick Operator
highlight def link hsSpecialChar SpecialChar

syn sync ccomment idrisDocComment,idrisLineComment,idrisBlockComment minlines=100
"syn sync fromstart

let b:current_syntax = "idris"