vim-vimlparser icon indicating copy to clipboard operation
vim-vimlparser copied to clipboard

Create VimlParser vital-module

Open haya14busa opened this issue 7 years ago • 12 comments
trafficstars

Create vital-module interface of vimlparser. See https://github.com/vim-jp/vital.vim for vital-module.

By introducing vital-module, users can use vimlparser as vital-module and we can mitigate the migration problem of breaking changes.

haya14busa avatar Nov 24 '17 13:11 haya14busa

Do we need to split some objects into each module?

  • VimlParser
  • VimlParser.StringReader
  • VimlParser.Compiler
  • ...

tyru avatar Nov 24 '17 13:11 tyru

I don't want to introduce changes caused by making vimlparser vital-module. Users are expected to use import() method only.

haya14busa avatar Nov 24 '17 14:11 haya14busa

Do we need to split some objects into each module?

We need to translate vimlparser.vim to python and javascript, so we cannot do this easily.

haya14busa avatar Nov 24 '17 14:11 haya14busa

We need to translate vimlparser.vim to python and javascript

ah, I forgot that. thanks.

tyru avatar Nov 24 '17 15:11 tyru

Codecov Report

Merging #74 into master will increase coverage by 0.36%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #74      +/-   ##
=========================================
+ Coverage   66.93%   67.3%   +0.36%     
=========================================
  Files           1       1              
  Lines        3590    3569      -21     
=========================================
- Hits         2403    2402       -1     
+ Misses       1187    1167      -20
Impacted Files Coverage Δ
autoload/vital/__vimlparser__/VimLParser.vim 67.3% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ae76039...67cead6. Read the comment docs.

codecov[bot] avatar Nov 25 '17 04:11 codecov[bot]

Test finally passed in travis CI! (Thanks to @thinca :+1:)

It's ready to review and merge. Can you take a look at this p-r? @mattn @tyru

haya14busa avatar Nov 25 '17 10:11 haya14busa

  • Change to autoload/vital/__vimlparser__/VimlParser.vim ? or remove them?

https://github.com/vim-jp/vim-vimlparser/blob/8c63d1a2bdf8f15960bfb5a5729c49cab319ea8f/scripts/update_builtin_commands.vim#L132 https://github.com/vim-jp/vim-vimlparser/blob/8c63d1a2bdf8f15960bfb5a5729c49cab319ea8f/scripts/update_builtin_commands.vim#L134

  • is it confusing that module name is VimlParser, but class(object) name is VimLParser?

tyru avatar Nov 25 '17 11:11 tyru

Thanks! Done.

haya14busa avatar Nov 25 '17 12:11 haya14busa

Currently, VimLParser seems to export following functions. Is this your expected?

isalnum Node ExArg islower isnamec iswordc1 isdigit iswhite import isvarname isalpha Err isnamec1 isargname isupper isxdigit iswordc isodigit isidc

mattn avatar Nov 25 '17 16:11 mattn

Yes, it's expected. I don't want to introduce changes caused by making it vital-module as much as possible. Also, the changes will be translated into other languages too and i feel a bit weird to add _ prefix to all script local functions.

s:import() should be only public API. I'll add comment.

haya14busa avatar Nov 26 '17 00:11 haya14busa

s:import() should be only public API. I'll add comment.

Done. 67cead6b35cfbdc4ee375b1dd5fa2bde1121b50b

haya14busa avatar Nov 26 '17 01:11 haya14busa

Besides that I believe this LGTM :sushi: as a vim-jp org but I prefer listening to other core devs voices.

ujihisa avatar Nov 26 '17 04:11 ujihisa