Commit Graph

48 Commits

Author SHA1 Message Date
Brandon Chinn 4e4c0af933
Fix multi-line-string-body grammar (#552)
* Make multi-line-string-body non-greedy

* Don't require string-character after quotes in multiline strings

* Prevent accidentally consuming triple quotes in multi-line-string-body

* Add test cases
2026-03-25 09:59:25 -07:00
Lars Willighagen 84911feb11
Remove mandatory node-space before slashdash and children block (#499)
* Remove mandatory node-space before slashdash

Fix #495

* Add tests

* Fix more tests

* Fix tests again
2025-01-28 16:48:09 -08:00
Bram Gotink c54ebd9473
Align test formatting (#501)
Other tests don't have quotes around strings if the string
is a valid identifier, this test is the odd one out.
2025-01-28 16:45:14 -08:00
Kat Marchán aab44fcd1b
minor tweaks to wording/clarifications (#484) 2025-01-22 16:52:12 -08:00
Tab Atkins Jr. 0c2dde6d3c
Support empty multiline strings (#483)
* Support empty multiline strings

Per <https://github.com/kdl-org/kdl/discussions/481>, the grammar doesn't actually allow the first and last newline in a multiline string to be the same (indicating an empty string). This looks like the minimal fix for it.

* Add tests for empty multilines

* remove accidental newline
2025-01-17 16:28:52 -08:00
Bram Gotink 646dafcd35
update vertical tab test (#449) 2024-12-23 11:49:12 -08:00
Kat Marchán 6ceecd85d6
Release KDL 2.0.0 (#434)
* Release KDL 2.0.0

* fix grammar for multiline quoted strings to allow escaped whitespace on closing line

* Add unicode-space to raw string

* Remove nonexistent equals-sign from the grammar (#435)

* fix multiline string tests

* grammar: fix disallowed-keyword-identifiers and string-character (#436)

* Back out "fix multiline string tests"

This backs out commit 0c5604b462.

* add extra javascript implementation (#437)

* reword interaction multiline + whitespace escape (#439)

* More tests for backslash behaviour (#438)

* More tests for baskslash behaviour

* Incorrect example of escaped final newline

* Test with non-literal indent

* Make line-space a superset of node-space (#440)

* Allow escline everywhere

* escline tests

* Always escape \ inside single quotes in the grammar text (#441)

to match the other uses of it and the metalanguage description below

* Add tests for mandatory whitespace between arguments or properties (#442)

* Add an optional version marker (#444)

* Add version marker to the grammer

* Add version marker to the Changelog

* Update SPEC.md

Co-authored-by: eilvelia <hi@eilvelia.cat>

* add a mandatory newline after the version marker

* add mandatory space between version number

---------

Co-authored-by: eilvelia <hi@eilvelia.cat>

* Fix a changelog line erroneously truncated in #444 (#445)

* fix: move vertical tab to the line-breaking whitespace to match Unicode (#446)

* add vertical tab change test

* final tweaks before release

---------

Co-authored-by: eilvelia <hi@eilvelia.cat>
Co-authored-by: Bram Gotink <bram@gotink.me>
Co-authored-by: Thomas Jollans <tjol@tjol.eu>
Co-authored-by: Evgeny <eugenesvk@users.noreply.github.com>
2024-12-21 18:33:50 -08:00
Thomas Jollans b82c924013
More tests for whitespace in multi-line strings (#432)
* More tests for whitespace in multi-line strings

* replace \r\n with \n in slashdash_newline_before_node.kdl
2024-12-12 13:15:04 -08:00
Kat Marchán 717e86cb1c
went over tests and tweaked a few things (#431) 2024-12-11 19:45:25 -08:00
Tab Atkins Jr. ebef8751c0
fix multiline_string_whitespace_only, closes #429
ws-only lines don't contribute *any* content to the string (beyond their existence as a newline)
2024-12-11 18:16:00 -08:00
Kat Marchán 171bc71f42
Allow node-space after slashdash and add a bunch more slashdash tests (#427)
Fixes: https://github.com/kdl-org/kdl/issues/426
2024-12-10 20:43:58 -08:00
Thomas Jollans 75a0869a6c
Clarify raw single-line string grammar (#425) 2024-12-10 16:45:35 -08:00
Tab Atkins Jr. a60d27c99d
KDL documents always end in a newline
In particular, other empty-document tests have an expected result containing one newline, like slashdash_full_node
2024-12-10 15:55:21 -08:00
Thomas Jollans ee41a76357
Additional test cases for slashdash and multi-line strings (#422) 2024-12-08 09:32:21 -08:00
Thomas Jollans 831ecc1d52
Allow quotes in multi-line strings (#419)
Fixes: https://github.com/kdl-org/kdl/issues/415
2024-12-08 01:07:31 -08:00
Emi 40aac6602e
Normalize space in expected output of unicode_silly (#412) 2024-12-02 00:06:46 -08:00
Kat Marchán 90e22bc789
[v2] more predictable slashdash (#407)
Fixes: https://github.com/kdl-org/kdl/issues/401
2024-11-28 22:53:42 -08:00
Kat Marchán 1588b1f5fd
get rid of syntactically significant unicode equals signs (#400)
Fixes: #399
2024-11-28 22:39:19 -08:00
Kat Marchán dadcfdf2ae
Update tests/test_cases/expected_kdl/multiline_raw_string_indented.kdl
Co-authored-by: Dani Smith <danini@hey.com>
2024-02-15 12:03:25 -08:00
Kat Marchán 2fcf6d42d3
Update tests/test_cases/expected_kdl/multiline_string_indented.kdl
Co-authored-by: Dani Smith <danini@hey.com>
2024-02-15 12:03:18 -08:00
Kat Marchán fa816ca6df
add floats
Fixes: https://github.com/kdl-org/kdl/issues/374
2024-02-12 23:17:52 -08:00
Kat Marchán 631ec14059
allow /- at the very beginning of a document 2024-02-12 23:00:50 -08:00
Kat Marchán 522ce8591e
clarify multi-line strings further 2024-02-07 11:33:47 -08:00
Corey Powell 29495006bc
KDL V2 Test Fixes (#368)
* Add newlines to some of the bare ident tests that were missing them

* eof_after_escape.kdl is valid according to spec
2024-01-06 14:50:37 -08:00
Tab Atkins-Bittner af91cc6319 Add tests for .1 and general 'ident ambiguous with a number' cases. 2024-01-04 11:12:10 -08:00
Tab Atkins-Bittner de37e11a29 Comments are now allowed in and around types (along with other types of ws) 2023-12-26 14:58:49 -08:00
Tab Atkins-Bittner 1294f9733d Fix tests about # in an ident string 2023-12-26 14:31:49 -08:00
Tab Atkins-Bittner 935d054d13 Fix more multiline tests 2023-12-26 14:28:25 -08:00
Tab Atkins-Bittner f02ba59c0c Make multi-line ws prefix determined by the last line. 2023-12-26 14:19:45 -08:00
Kat Marchán d53d99ff2e
test fixes 2023-12-17 13:37:37 -08:00
Kat Marchán 511ab6b6ff
missed a spot 2023-12-17 10:01:42 -08:00
Kat Marchán 90cd0b1bb9
make unicodey equals signs valid property assignment characters 2023-12-16 16:09:13 -08:00
Kat Marchán b51859edf3
update tests
Fixes: https://github.com/kdl-org/kdl/issues/359
2023-12-16 14:44:32 -08:00
Bram Gotink d437cf228b
Add test for empty single-line comment (#292) 2022-09-02 07:37:10 -07:00
Nathan West 825ff2c17d
Add escaped whitespace to KDL strings (#290)
* Add escaped whitespace to KDL spec

* Add test cases for escaped whitespace

* Spelling error
2022-08-31 21:49:01 -07:00
Bram Gotink 337bd1bccf
Update expected output of test with changed input (#289) 2022-08-30 10:44:44 -07:00
Tab Atkins Jr 05d16e0597
Per #223 discussion, this *should* be a parse error. (#226)
Fixes: #223
2021-10-07 08:01:18 -07:00
Tab Atkins Jr 93cc6724f2
Verify that a slash-dashed prop doesn't shadow a previous prop of the same name (#227) 2021-10-06 15:01:49 -07:00
Tab Atkins Jr 3f293ff01d
Empty children aren't reflected in the data model. (#219)
Fixes: https://github.com/kdl-org/kdl/issues/218
2021-10-05 20:27:28 -07:00
Tab Atkins Jr b22ed4b1b0
Add missing expected file (#217)
Per the grammar (`decimal := integer ('.' [0-9] [0-9_]*)? exponent?`), underscores in the fraction part should be allowed (as in `node 1.0_2`, the contents of the corresponding input file), but there was no expected_kdl file for this test case, indicating it's supposed to be a parse failure.

I'm assuming this was a mistake, since underscores in the fraction part make complete sense (and are allowed in the other two parts of a decimal number).
2021-10-04 17:47:24 -07:00
Danielle Smith 5a2f4969fe
fix: non-decimal test output according to docs (#196) 2021-09-27 17:44:21 -07:00
Danielle Smith 05af2fb657
fix: do not escape solidus (forwardslash) in test (#198) 2021-09-27 17:42:30 -07:00
Ben Reinhart 24faa6b75c
tests: add more coverage for keywords (#189) 2021-09-20 19:01:48 -07:00
Hannah Kolbeck f59ca2476a
Add type annotation tests from kdl4j and tweak unusual char in quoted id test (#181)
Co-authored-by: Hannah Kolbeck <hannah.kolbeck@streem.com>
2021-09-19 08:11:19 -07:00
Ben Reinhart 8ca18fec0a
tests: ensure output of illegal ident is quoted (#178) 2021-09-17 13:33:56 -07:00
Dave Anderson 0bbe723eb5
tests: adjust bare identifier inputs to match spec. (#168)
/ is not a valid identifier character. This updates
unusual_chars_in_bare_id.kdl to only include unusual but valid
identifier characters, and adds separate invalid input tests
for non-identifier characters.

Fixes #166
2021-09-16 10:46:22 -07:00
Chris Babcock 8ae4ae648e
Preserve duplicate nodes (#167)
Fixes: https://github.com/kdl-org/kdl/issues/165
2021-09-16 01:46:26 -07:00
Kat Marchán fd478c29c7
bring over test suite from kdl4j (#119) 2021-08-31 22:25:11 -07:00