-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathSexp.vim
More file actions
25 lines (21 loc) · 847 Bytes
/
Sexp.vim
File metadata and controls
25 lines (21 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
scriptencoding utf-8
let s:suite = themis#suite('Deprecated.Text.Sexp')
let s:assert = themis#helper('assert')
let s:has_lua = has('lua') && exists('*luaeval')
function! s:suite.before()
if !s:has_lua
return
endif
let s:S = vital#vital#new().import('Deprecated.Text.Sexp')
endfunction
function! s:suite.after()
unlet! s:S
endfunction
function! s:suite.parse()
if !s:has_lua
call s:assert.skip('Vital.Deprecated.Text.Sexp: any function call needs if_lua')
endif
call s:assert.equals(
\ s:S.parse('(a b c)'),
\ [[{'label': 'identifier', 'col': 2, 'matched_text': 'a'}, {'label': 'whitespace', 'col': 3, 'matched_text': ' '}, {'label': 'identifier', 'col': 4, 'matched_text': 'b'}, {'label': 'whitespace', 'col': 5, 'matched_text': ' '}, {'label': 'identifier', 'col': 6, 'matched_text': 'c'}]])
endfunction