aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Germishuys <jacquesg@striata.com>2020-09-01 12:38:42 +0100
committerJacques Germishuys <jacquesg@striata.com>2020-09-03 09:57:59 +0100
commit7725fd9880471aca0f90b17e307ef33979f85a31 (patch)
tree66e758f74028be1be8cacb30895595200147f2cb
parent8c6e96bb50f0341e8bdf659e8b1f4499a47cbc9f (diff)
downloadrneovim-7725fd9880471aca0f90b17e307ef33979f85a31.tar.gz
rneovim-7725fd9880471aca0f90b17e307ef33979f85a31.tar.bz2
rneovim-7725fd9880471aca0f90b17e307ef33979f85a31.zip
added perleval() documentation
-rw-r--r--runtime/doc/eval.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index ca03ee0374..610d8da822 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2288,6 +2288,7 @@ nr2char({expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
nvim_...({args}...) any call nvim |api| functions
or({expr}, {expr}) Number bitwise OR
pathshorten({expr}) String shorten directory names in a path
+perleval({expr}) any evaluate |perl| expression
pow({x}, {y}) Float {x} to the power of {y}
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
printf({fmt}, {expr1}...) String format text
@@ -6423,6 +6424,21 @@ pathshorten({expr}) *pathshorten()*
< ~/.c/n/a/file1.vim ~
It doesn't matter if the path exists or not.
+perleval({expr}) *perleval()*
+ Evaluate |perl| expression {expr} and return its result
+ converted to Vim data structures.
+ Numbers and strings are returned as they are (strings are
+ copied though).
+ Lists are represented as Vim |List| type.
+ Dictionaries are represented as Vim |Dictionary| type,
+ non-string keys result in error.
+
+ Note: If you want an array or hash, {expr} must return a
+ reference to it.
+ Example: >
+ :echo perleval('[1 .. 4]')
+< [1, 2, 3, 4]
+
pow({x}, {y}) *pow()*
Return the power of {x} to the exponent {y} as a |Float|.
{x} and {y} must evaluate to a |Float| or a |Number|.