Vim::Parser - A Perl module for parsing Vimscript
version 0.01
use Vim::Parser;
my $parse_tree = Vim::Parser->parse_string($vimscript);
# - or -
my $parse_tree = Vim::Parser->parse_file($vimscript_file);
# XXX flesh out example of what the parse tree looks like
This module implements a parser for Vimscript, the configuration and scripting language used by the Vim text editor.
Parses the Vimscript code contained in $string
. Returns a parse tree that represents the parsed code.
Parses the Vimscript code contained in $filename_or_filehandle
, which can be a filename or a filehandle. Returns a parse tree like ""/parse_string does.
I'm writing this module chiefly to provide a parser for vimlint, so its requirements are (currently) fairly specific to the use cases required by vimlint. vimlint will assume that its inputs are valid Vimscript, so this module (at least for now) will as well. So if you pass an invalid Vimscript document to this parser, the return value is undefined. I don't mean 'undefined' as in undef
; I mean undefined as in you can't rely on it. This may (and will probably) change in the future.
Rob Hoelz <rob@hoelz.ro>
This software is copyright (c) 2013 by Rob Hoelz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please report any bugs or feature requests on the bugtracker website https://github.com/hoelzro/vim-parser/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Hey! The above document had some coding errors, which are explained below:
- Around line 34:
-
alternative text '""/parse_string' contains non-escaped | or /