Commit Graph

43 Commits

Author SHA1 Message Date
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
Kim Alvefur
5fa41624c9
Add support for Lua input (#1810) 2023-10-03 16:00:51 +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
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
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
Mike Farah
7103b78d38
Draft: Toml (#1439)
* toml wip

* wip

* Fixed auto parsing toml

* Added build flag not to include toml

* Parse toml docs and tests

* minor updates
2023-03-26 10:59:15 +11:00
Mike Farah
2195df9e7a Fixed xml encoding of ProcInst #1563, improved XML comment handling 2023-03-02 10:57:54 +11:00
Mike Farah
02be2b2918 Fixed issue where content surrounding tags are lost #1447 2022-11-27 17:29:27 +11:00
Mike Farah
88ce6ffcbe Hotfix: actually update the default xml attribute prefix #1428 2022-11-13 11:13:34 +11:00
Mike Farah
ececd00fbd Updated default xml naming prefix 2022-11-10 22:22:55 +11:00
Mike Farah
bd5e5dc965 Array to map operator for #1415 2022-11-08 13:40:00 +11:00
Mike Farah
880397d549
Refactored decoder responsibilities (#1402)
- improved comment handling
- yaml decoder now responsible for leading content work around
2022-10-28 14:16:46 +11:00
Mike Farah
c1640fb10d Removing old version notice 2022-10-25 12:47:13 +11:00
Mike Farah
6d6b693fb3
Added XML processing instructions and directive support (#1396) 2022-10-24 10:09:42 +11:00
Mike Farah
a91a8ccc66 Improving docs 2022-08-01 14:12:35 +10:00
Mike Farah
c8815f5ab9
Csv decoder (#1290)
* WIP: adding CSV decoder

* Adding CSV decoder

* Added CSV roundtrip

* Fixing from review
2022-08-01 10:28:34 +10:00
Mike Farah
b9a1ef89fe
Added NDJSON decoder (#1281) 2022-07-27 12:26:22 +10:00
Daniel Carbone
98b411f82e
adding support for --wrapScalar=false in properties encoder (#1241)
* adding support for --wrapScalar=false in properties encoder

* altering encoder and decoder tests somewhat

* adding .idea

* Revert "altering encoder and decoder tests somewhat"

This reverts commit e3655130e2.

* adding test scenario for encoding with wrapped scalars
2022-06-25 12:22:03 +10:00
rndmit
b9309a42a4
XML decoder additions (#1239)
* Add xml-keep-namespace and xml-raw-token features

* Add tests

* Change flags usage strings

* Append docs
2022-06-15 09:40:31 +10:00
Mike Farah
bbeae229ca Disable strict XML parsing by default #1155 2022-03-28 14:05:10 +11:00
Mike Farah
3924ed8a35 Bumping version 2022-03-10 13:50:53 +11:00
Mike Farah
edbdb16ab7 Fixes auto expansion of properties #1127 2022-03-01 11:29:11 +11:00
Mike Farah
d9bca65626 Added base64 support 2022-02-23 09:26:35 +11:00
Mike Farah
a9c3617b4f
Decoder Properties (#1099)
* Decoder Properties

* Added properties round trip test

* Fixed property decode for github actions

* Refactored XML test to use common functions

* Switched formatScenario parameter order for more readablity
2022-02-10 12:02:53 +11:00
Mike Farah
1f367ac200 Added notification banner to docs 2022-02-06 14:39:46 +11:00
Mike Farah
992fe066aa Improved property conversion docs 2022-02-01 15:34:17 +11:00
Mike Farah
a6fc7aa881 Updating docs 2022-01-28 10:06:25 +11:00
Mike Farah
6f24e878aa Updated README, better xml docs 2022-01-22 12:35:33 +11:00
Mike Farah
2526b03d67 Added JSON conversion tests and doc generation 2022-01-21 20:26:19 +11:00
Mike Farah
ec8ef312ef
Added XML encoding/decoding (#1067)
* Added XML encoding/decoding

* Minor fixes

* Improve yq doc

* Lint
2022-01-15 11:57:59 +11:00
Mike Farah
2ee9c65bc2 Added global xml prefs for simplicity 2021-12-21 16:52:54 +11:00
Mike Farah
6bcbd873a6 wip 2021-12-21 16:19:27 +11:00
Mike Farah
ae8df5ea87 wip 2021-12-21 16:08:37 +11:00
Mike Farah
851a43b9b6 wip 2021-12-21 15:56:08 +11:00
Mike Farah
df32baedf1
Added XML decoder (#1044) 2021-12-21 15:02:07 +11:00