Hi Bram, 2016/8/29 Mon 4:21:51 UTC+9 Bram Moolenaar wrote: > Manuel Ortega wrote: > > > At ":h lambda", there is some erroneous markup. It mistakenly is > > "|expr1|", which takes the user to the help for the ternary conditional! > > That is correct. This is the higest level expression. It's clearer if > you start with reading ":help expression-syntax".
I think I found some mistakes in ":help expression-syntax". Please check the attached patch. Misalignment is also fixed. Regards, Ken Takata -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
# HG changeset patch # Parent 756b6f9d956256cdff68f6cff0d7526e794ea023 diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -643,7 +643,7 @@ 2. Expression syntax *expression-syn Expression syntax summary, from least to most significant: -|expr1| expr2 ? expr1 : expr1 if-then-else +|expr1| expr2 ? expr1 : expr1 if-then-else |expr2| expr3 || expr3 .. logical OR @@ -674,16 +674,16 @@ Expression syntax summary, from least to expr7 / expr7 .. number division expr7 % expr7 .. number modulo -|expr7| ! expr7 logical NOT - - expr7 unary minus - + expr7 unary plus - -|expr8| expr8[expr1] byte of a String or item of a |List| - expr8[expr1 : expr1] substring of a String or sublist of a |List| - expr8.name entry in a |Dictionary| - expr8(expr1, ...) function call with |Funcref| variable - -|expr9| number number constant +|expr7| ! expr8 logical NOT + - expr8 unary minus + + expr8 unary plus + +|expr8| expr9[expr1] byte of a String or item of a |List| + expr9[expr1 : expr1] substring of a String or sublist of a |List| + expr9.name entry in a |Dictionary| + expr9(expr1, ...) function call with |Funcref| variable + +|expr9| number number constant "string" string constant, backslash is special 'string' string constant, ' is doubled [expr1, ...] |List| @@ -736,7 +736,9 @@ use in a variable such as "a:1". expr2 and expr3 *expr2* *expr3* --------------- - *expr-barbar* *expr-&&* +expr3 || expr3 .. logical OR *expr-barbar* +expr4 && expr4 .. logical AND *expr-&&* + The "||" and "&&" operators take one argument on each side. The arguments are (converted to) Numbers. The result is: @@ -925,9 +927,9 @@ None of these work for |Funcref|s. expr7 *expr7* ----- -! expr7 logical NOT *expr-!* -- expr7 unary minus *expr-unary--* -+ expr7 unary plus *expr-unary-+* +! expr8 logical NOT *expr-!* +- expr8 unary minus *expr-unary--* ++ expr8 unary plus *expr-unary-+* For '!' |TRUE| becomes |FALSE|, |FALSE| becomes |TRUE| (one). For '-' the sign of the number is changed. @@ -943,10 +945,10 @@ These three can be repeated and mixed. expr8 *expr8* ----- -expr8[expr1] item of String or |List| *expr-[]* *E111* +expr9[expr1] item of String or |List| *expr-[]* *E111* *E909* *subscript* -If expr8 is a Number or String this results in a String that contains the -expr1'th single byte from expr8. expr8 is used as a String, expr1 as a +If expr9 is a Number or String this results in a String that contains the +expr1'th single byte from expr9. expr9 is used as a String, expr1 as a Number. This doesn't recognize multi-byte encodings, see |byteidx()| for an alternative, or use `split()` to turn the string into a list of characters. @@ -959,7 +961,7 @@ If the length of the String is less than String. A negative index always results in an empty string (reason: backward compatibility). Use [-1:] to get the last byte. -If expr8 is a |List| then it results the item at index expr1. See |list-index| +If expr9 is a |List| then it results the item at index expr1. See |list-index| for possible index values. If the index is out of range this results in an error. Example: > :let item = mylist[-1] " get last item @@ -969,10 +971,10 @@ Generally, if a |List| index is equal to error. -expr8[expr1a : expr1b] substring or sublist *expr-[:]* - -If expr8 is a Number or String this results in the substring with the bytes -from expr1a to and including expr1b. expr8 is used as a String, expr1a and +expr9[expr1a : expr1b] substring or sublist *expr-[:]* + +If expr9 is a Number or String this results in the substring with the bytes +from expr1a to and including expr1b. expr9 is used as a String, expr1a and expr1b are used as a Number. This doesn't recognize multi-byte encodings, see |byteidx()| for computing the indexes. @@ -992,14 +994,14 @@ Examples: > :let s = s[:-3] " remove last two bytes < *slice* -If expr8 is a |List| this results in a new |List| with the items indicated by +If expr9 is a |List| this results in a new |List| with the items indicated by the indexes expr1a and expr1b. This works like with a String, as explained just above. Also see |sublist| below. Examples: > :let l = mylist[:3] " first four items :let l = mylist[4:4] " List with one item :let l = mylist[:] " shallow copy of a List -Using expr8[expr1] or expr8[expr1a : expr1b] on a |Funcref| results in an +Using expr9[expr1] or expr9[expr1a : expr1b] on a |Funcref| results in an error. Watch out for confusion between a namespace and a variable followed by a colon @@ -1008,11 +1010,11 @@ for a sublist: > mylist[s:] " uses namespace s:, error! -expr8.name entry in a |Dictionary| *expr-entry* - -If expr8 is a |Dictionary| and it is followed by a dot, then the following +expr9.name entry in a |Dictionary| *expr-entry* + +If expr9 is a |Dictionary| and it is followed by a dot, then the following name will be used as a key in the |Dictionary|. This is just like: -expr8[name]. +expr9[name]. The name must consist of alphanumeric characters, just like a variable name, but it may start with a number. Curly braces cannot be used. @@ -1028,9 +1030,9 @@ Note that the dot is also used for Strin always put spaces around the dot for String concatenation. -expr8(expr1, ...) |Funcref| function call - -When expr8 is a |Funcref| type variable, invoke the function it refers to. +expr9(expr1, ...) |Funcref| function call + +When expr9 is a |Funcref| type variable, invoke the function it refers to.
