diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-16 10:38:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-16 10:38:01 -0700 |
commit | 025ac4afc05331802ac9e81929eec740edabeb39 (patch) | |
tree | d6157d3bc0d6aa730a3dd10032b64ad6a4f40738 /testcases-cons | |
parent | 23442546290df93f6fb0f7bb0b9329ecf19b48fa (diff) | |
download | cppawk-025ac4afc05331802ac9e81929eec740edabeb39.tar.gz cppawk-025ac4afc05331802ac9e81929eec740edabeb39.tar.bz2 cppawk-025ac4afc05331802ac9e81929eec740edabeb39.zip |
cons: fields and set_fields: document, test.
Diffstat (limited to 'testcases-cons')
-rw-r--r-- | testcases-cons | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testcases-cons b/testcases-cons index 10d827b..ec7e6cb 100644 --- a/testcases-cons +++ b/testcases-cons @@ -754,3 +754,23 @@ BEGIN { : ("a" "b" "c") (1 2 3) +-- +40: +$cppawk ' +#include <cons.h> + +BEGIN { + $0 = "the quick brown fox" + print sexp(fields()) + + set_fields(list(1, cons(1, 2), "foo", box_str("foo"))) + + for (i = 1; i <= NF; i++) + print $i +}' +: +("the" "quick" "brown" "fox") +1 +C1,1:12 +foo +Tfoo |