Commit Graph

330 Commits

Author SHA1 Message Date
Mike Farah
b9a952ae6e Fixing tests 2023-10-18 11:10:42 +11:00
Mike Farah
20fdc250d3 Merge remote-tracking branch 'origin/master' into generic_ast 2023-10-17 14:57:07 +11:00
Kim Alvefur
7c78a15b23
Lua output fixes (#1811)
* encoder_lua: Handle explicitly positive infinity

* encoder_lua: Fix inclusion of pre-/suffix when prettyPrinted

It seems certain operations like --prettyPrint or subset selections does
not produce a DocumentNode, which is where the lua pre- and suffix was
printed, causing those to be omitted.

* encoder_lua: Improve Tag handling robustness

Using the method call seems more reliable in case the input parser
forgets to set the tag.
2023-10-12 11:25:26 +11:00
Mike Farah
b0ff65d6b7 Fixed update children problem with xml 2023-10-05 16:29:12 +11:00
Mike Farah
b2a3cb47a7 Merging from master 2023-10-05 16:01:24 +11:00
Mike Farah
d113344abf Added tonumber support #71 2023-10-05 15:15:01 +11:00
Kim Alvefur
5fa41624c9
Add support for Lua input (#1810) 2023-10-03 16:00:51 +11:00
Mike Farah
ee900ec997 Added kind operator 2023-10-02 14:43:12 +11:00
Mike Farah
0cf3adf5dd Adding another xml test; spelling fixes 2023-09-26 14:43:08 +10:00
-pthread -Wall
05ad1dad90
Fix typos (#1798) 2023-09-26 14:18:18 +10:00
Mike Farah
cdb9b56066 Spellig with cspell 2023-09-19 10:43:11 +10:00
Mike Farah
c66480448d Added recipes documentation 2023-09-01 14:40:33 +10:00
Mike Farah
cda69bff5e Adding recipes 2023-09-01 12:17:54 +10:00
Mike Farah
e5564c18fe Another xml example 2023-09-01 11:52:58 +10:00
Mike Farah
44c7f3aec3 Preparing release notes 2023-08-11 13:52:50 +10:00
Kim Alvefur
d302d75c77
Implement basic Lua output support (#1745)
* Implement basic Lua output support

Ref #1700

Basic but working serialization to Lua tables.

* Escape larger set of characters in Lua output

Started with a minimum of replacements, this should be more complete,
tho not all substitutions are strictly required in Lua.

* Print simple keys unquoted in Lua output

String keys that satisfy the requirements for variable names can be used
as keys without quotes in tables.

* Quote Lua keywords in table keys

Keywords are not valid as unquoted keys, thus must be quoted

* Make output of unquoted Lua table keys optional

Generally safer and simpler to not do it.

* Hook up settings for Lua output

* Allow special characters in Lua prefix and suffix

--lua-suffix='});^M' didn't work, so taking this approach instead

* Panic on unhandled YAML Kind in Lua encoder

* Handle YAML case varied booleans in Lua encoder

* Handle special-case numbers in Lua encoder

* Reject unhandled scalar Tags in Lua encoder

* Add note about how Lua nil is unsuitable as table key

Could add some context tracking in the future to allow rejecting nil in
a table key context.

* Return error instead of panic in Lua encoder

* Add initial test for Lua encoder

Boilerplate mostly copied from toml_test.go

* Additional Lua output tests

* Generate Lua encoder documentation

Mostly just for the boilerplate

* Convert octal for Lua output

Lua doesn't have the 0oNNN syntax for octal integers, only decimal and
hexadecimal, hence those can be passed trough as is while octal needs
special treatment.

* Implement indentation in in Lua output

* Respect string Style in Lua encoder

Lua has 'single', "double" and [[ long ]] strings.

* Expand Lua examples

* Output line comments in Lua output

* Implement Lua globals output mode
2023-08-11 12:56:49 +10:00
Mike Farah
49b8eafaf5 Comment processing fixes 2023-06-06 12:10:28 -07:00
Mike Farah
584ec998bc Unit tests pass! 2023-06-06 11:06:23 -07:00
Mike Farah
b2415f2ca5 Drop document type 2023-06-05 15:27:59 -07:00
Mike Farah
28909bbc5a Recurse doc problem 2023-06-05 14:46:59 -07:00
Mike Farah
fd67748078 Fixed styling + delete issue 2023-05-30 15:05:28 +10:00
Mike Farah
f6c3fab309 Fixed key issue 2023-05-30 11:58:41 +10:00
Mike Farah
d17216de3f Fixed group by issue 2023-05-30 11:39:25 +10:00
Mike Farah
d033ad570e Fixed create map issue 2023-05-30 11:34:31 +10:00
Mike Farah
82f717226c Fixed traverse issue 2023-05-30 08:46:51 +10:00
Mike Farah
d933c00904 Merge branch 'master' into generic_ast 2023-05-28 14:22:48 +10:00
Mike Farah
fcc04823ca Added docs on base64 only working with utf8 content 2023-05-23 15:38:08 +10:00
Mike Farah
5950329e2c Added docs on yes/no being strings in yaml spec 1.2 2023-05-23 15:35:39 +10:00
Mike Farah
d9357859ed use addChild methods 2023-05-09 13:51:21 +10:00
Mike Farah
0ca8a13e36 calculate document,filename and fileindex by parent 2023-05-05 15:19:58 +10:00
Mike Farah
68df67f550 wip 2023-05-05 14:13:18 +10:00
Mike Farah
cde32c156b fixed entries op 2023-05-04 19:46:35 +10:00
Mike Farah
4921302c28 merged from master 2023-05-04 19:27:37 +10:00
Mike Farah
9ba85a0a46 fixed json encode/decode 2023-05-04 19:22:33 +10:00
Giorgio Gallo
80b42b81fd
Implement shell output format (#1645)
* fix typo in a comment

* implement shell output format

* fix a typo

* add two test cases, have source uses ascii only

* add integration tests and documentation

* add fixes after code revieew
2023-05-04 11:06:56 +10:00
Mike Farah
e3ccd05a00 wip - rabbit hole :/ 2023-05-02 15:07:04 +10:00
Mike Farah
42843763ca wip - rabbit hole :/ 2023-05-02 14:07:59 +10:00
Mike Farah
cd50b35787 getting closer 2023-04-17 17:23:48 +10:00
Mike Farah
ee8cc90307 getting closer 2023-04-17 16:20:00 +10:00
Mike Farah
c525fa21c4 wip 2023-04-15 15:54:44 +10:00
Mike Farah
ade4819ea1 aliases 2023-04-15 15:24:40 +10:00
Mike Farah
648a08ef89 aliases 2023-04-15 15:07:23 +10:00
Mike Farah
49acb79ff1 aliases 2023-04-15 14:48:35 +10:00
Mike Farah
4ef84278a3 yaml aliases! 2023-04-15 14:36:24 +10:00
Mike Farah
4eca302efc yaml includes comments 2023-04-15 14:10:12 +10:00
Mike Farah
c38841ce20 wip 2023-04-13 15:40:41 +10:00
Mike Farah
1421a5a879 wip 2023-04-12 19:04:21 +10:00
Mike Farah
eb7844dd1d wip 2023-04-11 15:33:32 +10:00
Mike Farah
eba075294a Added scalar output for TOML (#1617) 2023-04-03 15:40:06 +10:00
Mike Farah
496035c75a toml docs 2023-03-31 10:24:12 +11:00