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

Deprecate Text.Sexp #591

Merged
merged 5 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ Module | Description
[Text.LTSV](doc/vital/Text/LTSV.txt) | LTSV library
[Text.Lexer](doc/vital/Text/Lexer.txt) | lexer library
[Text.Parser](doc/vital/Text/Parser.txt) | parser library
[Text.Sexp](doc/vital/Text/Sexp.txt) | S-Expression parser
[Text.TOML](doc/vital/Text/TOML.txt) | TOML library
[Text.Table](doc/vital/Text/Table.txt) | Character table library
[Vim.BufferManager](doc/vital/Vim/BufferManager.txt) | buffer manager
Expand Down
4 changes: 2 additions & 2 deletions autoload/vital/__vital__/Deprecated/Lua/Prelude.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ end

-- only for lua
function public.lua.rest(array, index)
-- TODO Text.Sexp also has one
-- TODO Deprecated.Text.Sexp also has one
index = index or 2
local rest = {}
for i = index, #array do
Expand All @@ -93,7 +93,7 @@ end

-- only for lua
function public.lua.cons(x, xs)
-- TODO Text.Sexp also has one
-- TODO Deprecated.Text.Sexp also has one
local memo = {x}
for _, v in ipairs(xs) do
table.insert(memo, v)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
" Text.Sexp
" Deprecated.Text.Sexp
" Author: Tatsuhiro Ujihisa

let s:save_cpo = &cpo
Expand Down Expand Up @@ -30,7 +30,7 @@ function! s:parse(sexp) abort
" return luaeval('vital_text_sexp.parse(_A)', a:sexp)
" return luaeval('vital_text_sexp.parse(vital_text_sexp.parse(_A))', a:sexp)
else
throw 'vital: Text.Sexp: any function call needs if_lua'
throw 'vital: Deprecated.Text.Sexp: any function call needs if_lua'
endif
endfunction

Expand Down
1 change: 0 additions & 1 deletion doc/vital.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ LINKS *Vital-links*
|vital/Text/LTSV.txt| LTSV library.
|vital/Text/Lexer.txt| lexer library.
|vital/Text/Parser.txt| parser library.
|vital/Text/Sexp.txt| S-Expression parser.
|vital/Text/TOML.txt| TOML library.
|vital/Text/Table.txt| Character table library.
|vital/Vim/Buffer.txt| Vim's buffer related stuff in general.
Expand Down
20 changes: 10 additions & 10 deletions doc/vital/Text/Sexp.txt → doc/vital/Deprecated/Text/Sexp.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
*vital/Text/Sexp.txt* S-Expression parser.
*vital/Deprecated/Text/Sexp.txt* S-Expression parser.

Maintainer: ujihisa <ujihisa at gmail com>

==============================================================================
CONTENTS *Vital.Text.Sexp-contents*
CONTENTS *Vital.Deprecated.Text.Sexp-contents*

INTRODUCTION |Vital.Text.Sexp-introduction|
INTERFACE |Vital.Text.Sexp-interface|
FUNCTIONS |Vital.Text.Sexp-functions|
INTRODUCTION |Vital.Deprecated.Text.Sexp-introduction|
INTERFACE |Vital.Deprecated.Text.Sexp-interface|
FUNCTIONS |Vital.Deprecated.Text.Sexp-functions|

==============================================================================
INTRODUCTION *Vital.Text.Sexp-introduction*
INTRODUCTION *Vital.Deprecated.Text.Sexp-introduction*

*Vital.Text.Sexp* is a S-Expression parsing library. For performance it uses
*Vital.Deprecated.Text.Sexp* is a S-Expression parsing library. For performance it uses
lua, so the Vim that runs this needs |+lua|.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a notation that this module was deprecated? (though it's obvious from its module name...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also an option, but I feel that it's verbose to repeat there. (Alternative option would be to insert warning message when you use, but before that the plugin author need to rename the module, so it's still verbose)


==============================================================================
INTERFACE *Vital.Text.Sexp-interface*
INTERFACE *Vital.Deprecated.Text.Sexp-interface*

------------------------------------------------------------------------------
FUNCTIONS *Vital.Text.Sexp-functions*
FUNCTIONS *Vital.Deprecated.Text.Sexp-functions*

parse({string}) *Vital.Text.Sexp.parse()*
parse({string}) *Vital.Deprecated.Text.Sexp.parse()*
Requires |+lua|.

Parses Sexp formatted string. It returns a |List| that contains
Expand Down
6 changes: 3 additions & 3 deletions test/Text/Sexp.vim → test/Deprecated/Text/Sexp.vim
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
scriptencoding utf-8

let s:suite = themis#suite('Text.Sexp')
let s:suite = themis#suite('Deprecated.Text.Sexp')
let s:assert = themis#helper('assert')

function! s:suite.before()
let s:S = vital#vital#new().import('Text.Sexp')
let s:S = vital#vital#new().import('Deprecated.Text.Sexp')
endfunction

function! s:suite.after()
Expand All @@ -13,7 +13,7 @@ endfunction

function! s:suite.parse()
if !has('lua') || !exists('*luaeval')
call s:assert.skip('Vital.Text.Sexp: any function call needs if_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)'),
Expand Down