From 37723be4c8b49b785c40fe5ccd34edbc7c018e1b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 7 Feb 2024 18:51:15 -0500 Subject: Fix parsing NQuads lines with no space before the final dot --- NEWS | 6 ++++++ meson.build | 2 +- src/n3.c | 2 +- src/serd_config.h | 2 +- test/extra/good/manifest.ttl | 12 ++++++++++++ test/extra/good/test-nq-syntax-dot-end.nq | 5 +++++ test/extra/good/test-nt-syntax-dot-end.nt | 5 +++++ 7 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 test/extra/good/test-nq-syntax-dot-end.nq create mode 100644 test/extra/good/test-nt-syntax-dot-end.nt diff --git a/NEWS b/NEWS index 195a69df..ea0aaeba 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +serd (0.32.3) unstable; urgency=medium + + * Fix parsing NQuads lines with no space before the final dot + + -- David Robillard Fri, 09 Feb 2024 15:46:08 +0000 + serd (0.32.2) stable; urgency=medium * Enable clang nullability checks diff --git a/meson.build b/meson.build index 2f5c697b..33233234 100644 --- a/meson.build +++ b/meson.build @@ -12,7 +12,7 @@ project( ], license: 'ISC', meson_version: '>= 0.56.0', - version: '0.32.2', + version: '0.32.3', ) serd_src_root = meson.current_source_dir() diff --git a/src/n3.c b/src/n3.c index e713a828..4f7ddd47 100644 --- a/src/n3.c +++ b/src/n3.c @@ -1763,7 +1763,7 @@ read_nquads_statement(SerdReader* const reader) // Terminating '.' read_ws_star(reader); - if (!eat_byte_check(reader, '.')) { + if (!ate_dot && !eat_byte_check(reader, '.')) { return SERD_ERR_BAD_SYNTAX; } } diff --git a/src/serd_config.h b/src/serd_config.h index 745232b8..150ffb81 100644 --- a/src/serd_config.h +++ b/src/serd_config.h @@ -36,7 +36,7 @@ #define SERD_SRC_SERD_CONFIG_H // Define version unconditionally so a warning will catch a mismatch -#define SERD_VERSION "0.32.2" +#define SERD_VERSION "0.32.3" #if !defined(SERD_NO_DEFAULT_CONFIG) diff --git a/test/extra/good/manifest.ttl b/test/extra/good/manifest.ttl index 24b301e9..5f4e8761 100644 --- a/test/extra/good/manifest.ttl +++ b/test/extra/good/manifest.ttl @@ -31,6 +31,8 @@ <#test-long-utf8> <#test-no-spaces> <#test-non-curie-uri> + <#test-nq-syntax-dot-end> + <#test-nt-syntax-dot-end> <#test-out-of-range-unicode> <#test-prefix> <#test-quote-escapes> @@ -191,6 +193,16 @@ mf:name "test-non-curie-uri" ; mf:result . +<#test-nq-syntax-dot-end> + a rdft:TestNQuadsPositiveSyntax ; + mf:action ; + mf:name "test-nq-syntax-dot-end" . + +<#test-nt-syntax-dot-end> + a rdft:TestNQuadsPositiveSyntax ; + mf:action ; + mf:name "test-nt-syntax-dot-end" . + <#test-out-of-range-unicode> a rdft:TestTurtleEval ; mf:action ; diff --git a/test/extra/good/test-nq-syntax-dot-end.nq b/test/extra/good/test-nq-syntax-dot-end.nq new file mode 100644 index 00000000..862e326c --- /dev/null +++ b/test/extra/good/test-nq-syntax-dot-end.nq @@ -0,0 +1,5 @@ + _:o _:g . + _:o _:g . + _:o _:h. + _:o _:h. + _:o _:what.how. \ No newline at end of file diff --git a/test/extra/good/test-nt-syntax-dot-end.nt b/test/extra/good/test-nt-syntax-dot-end.nt new file mode 100644 index 00000000..f4e3b874 --- /dev/null +++ b/test/extra/good/test-nt-syntax-dot-end.nt @@ -0,0 +1,5 @@ + _:o . + _:o . + _:o. + _:o. + _:what.how. \ No newline at end of file -- cgit v1.2.1