Last active
April 1, 2020 12:42
-
-
Save brv00/c97a80c67b2d4f5d5d924e04ebf610b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" SchemeのシンタックスハイライトにJSchemeのシンタックスハイライトを追加する。 | |
" 数値リテラルはJSchemeに存在しない形式に対するハイライトの取り消しも行う。 | |
if !exists("g:attach_jscheme_highlight") | |
finish | |
elseif !g:atach_jscheme_highlight | |
hi link schemeNumber Number | |
finish | |
endif | |
" JScheme の数値リテラルと一部の定数をハイライトする | |
" Schemeの数値リテラルでJSchemeの数値リテラルでない文字列はハイライトされない | |
syn case ignore | |
syn match jschemeExact /\<[+\-]*[0-9]\+l\?\>/ | |
syn match jschemeNumber /\<\([+\-]*[0-9]\+\.\?[0-9]*\|\.[0-9]\+\)\(d\|f\|e[+\-]\?[0-9]\+\)\?\>/ | |
syn case match | |
syn match jschemeConstant /\<\(java\.lang\.\)\?Math\.\(PI\|E\)\$\>/ | |
hi link jschemeExact Number | |
hi link jschemeNumber Number | |
hi link jschemeConstant Number | |
hi link schemeNumber None | |
" Quasi-stringとStrong quasi-stringをハイライトする | |
" ($VIMRUNTIME/syntax/scheme.vimのschemeFormのコピペ) | |
syn region jschemeBracketExpression matchgroup=schemeParentheses start="\[" end="\]" contains=ALLBUT,schemeUnquote,schemeDatumCommentForm,@schemeImportCluster | |
syn region jschemeQuasiString start=/{/ end=/}/ contains=jschemeBracketExpression | |
" ($VIMRUNTIME/syntax/scheme.vimの..snip) | |
syn region jschemeBracketExpressionStrong matchgroup=schemeParentheses start="#\[" end="\]#" contains=ALLBUT,schemeUnquote,schemeDatumCommentForm,@schemeImportCluster | |
syn region jschemeStrongQuasiString start=/#{/ end=/}#/ contains=jschemeBracketExpressionStrong | |
hi link jschemeQuasiString String | |
hi link jschemeStrongQuasiString String | |
" define以外の定義をハイライトする | |
syn keyword schemeSyntax define-method | |
syn keyword schemeSyntax define-macro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1e3 1.0E-3 5 60l 77L 3.1415 5E+6 ;有効 | |
3 +19 -100000 20842308923089237489374 ;有効 | |
3/4 -5/6 1/1208203823 ;*無効 | |
1.5 0.034 -10e-10 1.5e-5 2e3 1e0 ;有効 | |
3.141592653589793D 3.1415927f ;有効 | |
3.141592653589793238L ;*無効 | |
3+4i 3.2-3/4i +i -3e-5i 1.1@1.764 #e1 #e1/1 ;*無効 | |
#b10101 #o72 #xC7 ;*無効 | |
Math.PI$ java.lang.Math.E$ ;有効 | |
Math.PI$java.lang.Math.E$ ;*無効 | |
Math.PI java.Math.E$ lang.Math.E$ .Math.E$ ;*無効 | |
{This is first quasi-string.} | |
{This is [(substring {[(second (second (time 1234567890)))]} 1 4)]ond quasi-string.} | |
{A "normal string" is in a quasi-string.} | |
{A "normal string" \"followed by escaped\" is in a quasi-string.} | |
#{This is first strong quasi-string.}# | |
#{This is [(substring {[(second (second (time 1234567890)))]} 1 4)]ond strong quasi-string.}# | |
#{This is #[(substring {[(second (second (time 1234567890)))]} 1 4) | |
]#ond strong quasi-string again.}# | |
(define-macro (receive x v . e) `(,call-with-values (lambda () ,v) (lambda ,x . ,e))) | |
(define-method (iota (count Integer) (start Number) (step Number)) | |
(do ((i 0 (+ i 1)) (fst (+ start (* step (- count 1))) (- fst step)) | |
(dst '() `(,fst . ,dst))) | |
((>= i count) dst))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment