diff --git a/docs/src/mk-func-info.rb b/docs/src/mk-func-info.rb index 6698358aa..cbf772198 100755 --- a/docs/src/mk-func-info.rb +++ b/docs/src/mk-func-info.rb @@ -97,7 +97,8 @@ def make_func_details puts if display_name != link_name - puts "" + puts " " + puts "" end puts "### #{display_name}" diff --git a/docs/src/reference-dsl-builtin-functions.md b/docs/src/reference-dsl-builtin-functions.md index 17b9db525..b4f97f79a 100644 --- a/docs/src/reference-dsl-builtin-functions.md +++ b/docs/src/reference-dsl-builtin-functions.md @@ -118,126 +118,144 @@ pow (class=arithmetic #args=2) Exponentiation. Same as **, but as a function. - + + ### %
% (class=arithmetic #args=2) Remainder; never negative-valued (pythonic).- + + ### &
& (class=arithmetic #args=2) Bitwise AND.- + + ### \*
* (class=arithmetic #args=2) Multiplication, with integer*integer overflow to float.- + + ### \**
** (class=arithmetic #args=2) Exponentiation. Same as pow, but as an infix operator.- + + ### \+
+ (class=arithmetic #args=1,2) Addition as binary operator; unary plus operator.- + + ### \-
- (class=arithmetic #args=1,2) Subtraction as binary operator; unary negation operator.- + + ### \.\*
.* (class=arithmetic #args=2) Multiplication, with integer-to-integer overflow.- + + ### \.\+
.+ (class=arithmetic #args=2) Addition, with integer-to-integer overflow.- + + ### \.\-
.- (class=arithmetic #args=2) Subtraction, with integer-to-integer overflow.- + + ### \./
./ (class=arithmetic #args=2) Integer division, rounding toward zero.- + + ### /
/ (class=arithmetic #args=2) Division. Integer / integer is integer when exact, else floating-point: e.g. 6/3 is 2 but 6/4 is 1.5.- + + ### //
// (class=arithmetic #args=2) Pythonic integer division, rounding toward negative.- + + ### <<
<< (class=arithmetic #args=2) Bitwise left-shift.- + + ### >>
>> (class=arithmetic #args=2) Bitwise signed right-shift.- + + ### >>>
>>> (class=arithmetic #args=2) Bitwise unsigned right-shift.- + + ### ^
^ (class=arithmetic #args=2) Bitwise XOR.- + + ### \|
| (class=arithmetic #args=2) Bitwise OR.- + + ### ~
~ (class=arithmetic #args=1) Bitwise NOT. Beware '$y=~$x' since =~ is the regex-match operator: try '$y = ~$x'. @@ -246,42 +264,48 @@ pow (class=arithmetic #args=2) Exponentiation. Same as **, but as a function. ## Boolean functions - + + ### \!! (class=boolean #args=1) Logical negation.- + + ### \!=!= (class=boolean #args=2) String/numeric inequality. Mixing number and string results in string compare.- + + ### !=~!=~ (class=boolean #args=2) String (left-hand side) does not match regex (right-hand side), e.g. '$name !=~ "^a.*b$"'.- + + ### &&&& (class=boolean #args=2) Logical AND.- + + ### << (class=boolean #args=2) String/numeric less-than. Mixing number and string results in string compare.- + + ### <=<= (class=boolean #args=2) String/numeric less-than-or-equals. Mixing number and string results in string compare. @@ -294,14 +318,16 @@ pow (class=arithmetic #args=2) Exponentiation. Same as **, but as a function.- + + ### ==== (class=boolean #args=2) String/numeric equality. Mixing number and string results in string compare.- + + ### =~=~ (class=boolean #args=2) String (left-hand side) matches regex (right-hand side), e.g. '$name =~ "^a.*b$"'. Capture groups \1 through \9 are matched from (...) in the right-hand side, and can be used within subsequent DSL statements. See also "Regular expressions" at https://miller.readthedocs.io. @@ -311,49 +337,56 @@ Without if-statement: given $line = "index ab09 file", and $line =~ "([a-z][a-z]- + + ### >> (class=boolean #args=2) String/numeric greater-than. Mixing number and string results in string compare.- + + ### >=>= (class=boolean #args=2) String/numeric greater-than-or-equals. Mixing number and string results in string compare.- + + ### ?:?: (class=boolean #args=3) Standard ternary operator.- + + ### ???? (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record.- + + ### ?????? (class=boolean #args=2) Absent/empty-coalesce operator. $a ??? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value.- + + ### ^^^^ (class=boolean #args=2) Logical XOR.- + + ### \|\||| (class=boolean #args=2) Logical OR. @@ -1073,8 +1106,8 @@ truncate (class=string #args=2) Truncates string first argument to max length ounformat (class=string #args=2) Using first argument as format string, unpacks second argument into an array of matches, with type-inference. On non-match, returns error -- use is_error() to check. Examples: -unformat("{}:{}:{}", "1:2:3") gives [1, 2, 3]. -unformat("{}h{}m{}s", "3h47m22s") gives [3, 47, 22]. +unformat("{}:{}:{}", "1:2:3") gives [1, 2, 3]". +unformat("{}h{}m{}s", "3h47m22s") gives [3, 47, 22]". is_error(unformat("{}h{}m{}s", "3:47:22")) gives true.@@ -1083,16 +1116,17 @@ is_error(unformat("{}h{}m{}s", "3:47:22")) gives true.unformatx (class=string #args=2) Same as unformat, but without type-inference. Examples: -unformatx("{}:{}:{}", "1:2:3") gives ["1", "2", "3"]. -unformatx("{}h{}m{}s", "3h47m22s") gives ["3", "47", "22"]. +unformatx("{}:{}:{}", "1:2:3") gives ["1", "2", "3"]". +unformatx("{}h{}m{}s", "3h47m22s") gives ["3", "47", "22"]". is_error(unformatx("{}h{}m{}s", "3:47:22")) gives true.- + + ### \.-. (class=string #args=2) String concatenation. Non-strings are coerced, so you can do '"ax".98' etc. +. (class=string #args=2) String concatenation.## System functions