aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--include/serd/serd.h4
-rw-r--r--src/n3.c30
-rw-r--r--src/node.c12
-rw-r--r--src/reader.h2
-rw-r--r--src/serdi.c2
-rw-r--r--src/uri.c6
-rw-r--r--src/writer.c2
8 files changed, 31 insertions, 30 deletions
diff --git a/NEWS b/NEWS
index 40c994ce..fe0d5cca 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ serd (0.31.0) unstable; urgency=medium
* Add serd_reader_skip_until_byte() to public API
* Allow SERD_API to be defined by the user
* Avoid creating test files in the current directory
+ * Avoid using ASCII grave as a quote
* Clean up code
* Fix crash when trying to read chunks without starting
* Fix hang when skipping an error at EOF when lax parsing
@@ -14,7 +15,7 @@ serd (0.31.0) unstable; urgency=medium
* Replace duplicated dox_to_sphinx script with sphinxygen dependency
* Test header for warnings more strictly
- -- David Robillard <d@drobilla.net> Mon, 19 Dec 2022 23:55:26 +0000
+ -- David Robillard <d@drobilla.net> Tue, 20 Dec 2022 12:31:33 +0000
serd (0.30.16) stable; urgency=medium
diff --git a/include/serd/serd.h b/include/serd/serd.h
index c1d1a8b1..cc42c842 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -478,8 +478,8 @@ serd_node_new_relative_uri(const SerdURI* SERD_NONNULL uri,
/**
Create a new node by serialising `d` into an xsd:decimal string.
- The resulting node will always contain a `.', start with a digit, and end
- with a digit (i.e. will have a leading and/or trailing `0' if necessary).
+ The resulting node will always contain a '.', start with a digit, and end
+ with a digit (i.e. will have a leading and/or trailing '0' if necessary).
It will never be in scientific notation. A maximum of `frac_digits` digits
will be written after the decimal point, but trailing zeros will
automatically be omitted (except one if `d` is a round integer).
diff --git a/src/n3.c b/src/n3.c
index 6577fa3b..11461e76 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -54,7 +54,7 @@ read_HEX(SerdReader* const reader)
return (uint8_t)eat_byte_safe(reader, c);
}
- r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid hexadecimal digit `%c'\n", c);
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid hexadecimal digit '%c'\n", c);
return 0;
}
@@ -340,7 +340,7 @@ read_STRING_LITERAL_LONG(SerdReader* const reader,
uint32_t code = 0;
if ((st = read_ECHAR(reader, ref, flags)) &&
(st = read_UCHAR(reader, ref, &code))) {
- return r_err(reader, st, "invalid escape `\\%c'\n", peek_byte(reader));
+ return r_err(reader, st, "invalid escape '\\%c'\n", peek_byte(reader));
}
} else if (c == q) {
skip_byte(reader, q);
@@ -388,7 +388,7 @@ read_STRING_LITERAL(SerdReader* const reader,
skip_byte(reader, c);
if ((st = read_ECHAR(reader, ref, flags)) &&
(st = read_UCHAR(reader, ref, &code))) {
- return r_err(reader, st, "invalid escape `\\%c'\n", peek_byte(reader));
+ return r_err(reader, st, "invalid escape '\\%c'\n", peek_byte(reader));
}
break;
default:
@@ -629,7 +629,7 @@ read_PN_PREFIX_tail(SerdReader* const reader, const Ref dest)
const SerdNode* const n = deref(reader, dest);
if (n->buf[n->n_bytes - 1] == '.' && read_PN_CHARS(reader, dest)) {
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "prefix ends with `.'\n");
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "prefix ends with '.'\n");
}
return SERD_SUCCESS;
@@ -650,7 +650,7 @@ read_LANGTAG(SerdReader* const reader, Ref* const dest)
{
int c = peek_byte(reader);
if (!is_alpha(c)) {
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected `%c'\n", c);
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected '%c'\n", c);
}
*dest = push_node(reader, SERD_LITERAL, "", 0);
@@ -676,7 +676,7 @@ read_IRIREF_scheme(SerdReader* const reader, const Ref dest)
{
int c = peek_byte(reader);
if (!is_alpha(c)) {
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "bad IRI scheme start `%c'\n", c);
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "bad IRI scheme start '%c'\n", c);
}
while ((c = peek_byte(reader)) != EOF) {
@@ -724,7 +724,7 @@ read_IRIREF(SerdReader* const reader, Ref* const dest)
case '<':
*dest = pop_node(reader, *dest);
return r_err(
- reader, SERD_ERR_BAD_SYNTAX, "invalid IRI character `%c'\n", c);
+ reader, SERD_ERR_BAD_SYNTAX, "invalid IRI character '%c'\n", c);
case '>':
return SERD_SUCCESS;
@@ -757,7 +757,7 @@ read_IRIREF(SerdReader* const reader, Ref* const dest)
case '}':
*dest = pop_node(reader, *dest);
return r_err(
- reader, SERD_ERR_BAD_SYNTAX, "invalid IRI character `%c'\n", c);
+ reader, SERD_ERR_BAD_SYNTAX, "invalid IRI character '%c'\n", c);
default:
if (c <= 0x20) {
@@ -844,7 +844,7 @@ read_number(SerdReader* const reader,
}
if ((c = peek_byte(reader)) == '.') {
has_decimal = true;
- // decimal case 2 (e.g. '.0' or `-.0' or `+.0')
+ // decimal case 2 (e.g. '.0' or '-.0' or '+.0')
push_byte(reader, *dest, eat_byte_safe(reader, c));
TRY(st, read_0_9(reader, *dest, true));
} else {
@@ -931,7 +931,7 @@ read_literal(SerdReader* const reader,
case '^':
skip_byte(reader, '^');
if (!eat_byte_check(reader, '^')) {
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "expected `^'\n");
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "expected '^'\n");
}
if ((st = read_iri(reader, datatype, ate_dot))) {
@@ -1027,7 +1027,7 @@ read_BLANK_NODE_LABEL(SerdReader* const reader,
*dest = pop_node(reader, *dest);
return r_err(reader,
SERD_ERR_ID_CLASH,
- "found both `b' and `B' blank IDs, prefix required\n");
+ "found both 'b' and 'B' blank IDs, prefix required\n");
}
}
}
@@ -1039,7 +1039,7 @@ static Ref
read_blankName(SerdReader* const reader)
{
if (skip_byte(reader, '=') || eat_byte_check(reader, '=') != '=') {
- r_err(reader, SERD_ERR_BAD_SYNTAX, "expected `='\n");
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "expected '='\n");
return 0;
}
@@ -1089,7 +1089,7 @@ read_anon(SerdReader* const reader,
bool ate_dot_in_list = false;
read_predicateObjectList(reader, ctx, &ate_dot_in_list);
if (ate_dot_in_list) {
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "`.' inside blank\n");
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "'.' inside blank\n");
}
read_ws_star(reader);
@@ -1383,7 +1383,7 @@ read_subject(SerdReader* const reader,
if (ate_dot) {
pop_node(reader, *dest);
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "subject ends with `.'\n");
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "subject ends with '.'\n");
}
return st;
@@ -1560,7 +1560,7 @@ read_wrappedGraph(SerdReader* const reader, ReadContext* const ctx)
skip_byte(reader, '}');
read_ws_star(reader);
if (peek_byte(reader) == '.') {
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "graph followed by `.'\n");
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "graph followed by '.'\n");
}
return SERD_SUCCESS;
diff --git a/src/node.c b/src/node.c
index addaa07b..7e8ebeb9 100644
--- a/src/node.c
+++ b/src/node.c
@@ -36,13 +36,13 @@ serd_uri_string_length(const SerdURI* const uri)
len += (field).len + (n_delims); \
}
- ADD_LEN(uri->path, 1) // + possible leading `/'
- ADD_LEN(uri->scheme, 1) // + trailing `:'
- ADD_LEN(uri->authority, 2) // + leading `//'
- ADD_LEN(uri->query, 1) // + leading `?'
- ADD_LEN(uri->fragment, 1) // + leading `#'
+ ADD_LEN(uri->path, 1) // + possible leading '/'
+ ADD_LEN(uri->scheme, 1) // + trailing ':'
+ ADD_LEN(uri->authority, 2) // + leading '//'
+ ADD_LEN(uri->query, 1) // + leading '?'
+ ADD_LEN(uri->fragment, 1) // + leading '#'
- return len + 2; // + 2 for authority `//'
+ return len + 2; // + 2 for authority '//'
}
static size_t
diff --git a/src/reader.h b/src/reader.h
index e2f8cdb9..0ec48380 100644
--- a/src/reader.h
+++ b/src/reader.h
@@ -146,7 +146,7 @@ eat_byte_check(SerdReader* reader, const int byte)
{
const int c = peek_byte(reader);
if (c != byte) {
- r_err(reader, SERD_ERR_BAD_SYNTAX, "expected `%c', not `%c'\n", byte, c);
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "expected '%c', not '%c'\n", byte, c);
return 0;
}
return eat_byte_safe(reader, byte);
diff --git a/src/serdi.c b/src/serdi.c
index 097226e4..a5a00c57 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -49,7 +49,7 @@ get_syntax(const char* const name)
}
}
- SERDI_ERRORF("unknown syntax `%s'\n", name);
+ SERDI_ERRORF("unknown syntax '%s'\n", name);
return (SerdSyntax)0;
}
diff --git a/src/uri.c b/src/uri.c
index 151f63e3..8acb79b3 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -18,7 +18,7 @@ serd_uri_to_path(const uint8_t* uri)
const uint8_t* path = uri;
if (!is_windows_path(uri) && serd_uri_string_has_scheme(uri)) {
if (!!strncmp((const char*)uri, "file:", 5)) {
- fprintf(stderr, "Non-file URI `%s'\n", uri);
+ fprintf(stderr, "Non-file URI '%s'\n", uri);
return NULL;
}
@@ -27,7 +27,7 @@ serd_uri_to_path(const uint8_t* uri)
} else if (!strncmp((const char*)uri, "file://", 7)) {
path = uri + 7;
} else {
- fprintf(stderr, "Invalid file URI `%s'\n", uri);
+ fprintf(stderr, "Invalid file URI '%s'\n", uri);
return NULL;
}
@@ -485,7 +485,7 @@ serd_uri_serialise_relative(const SerdURI* const uri,
}
if (uri->fragment.buf) {
- // Note uri->fragment.buf includes the leading `#'
+ // Note uri->fragment.buf includes the leading '#'
len += sink(uri->fragment.buf, uri->fragment.len, stream);
}
diff --git a/src/writer.c b/src/writer.c
index d2609cf5..341ee79b 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -642,7 +642,7 @@ write_curie(SerdWriter* const writer,
case SERD_NTRIPLES:
case SERD_NQUADS:
if ((st = serd_env_expand(writer->env, node, &prefix, &suffix))) {
- w_err(writer, st, "undefined namespace prefix `%s'\n", node->buf);
+ w_err(writer, st, "undefined namespace prefix '%s'\n", node->buf);
return false;
}
write_sep(writer, SEP_URI_BEGIN);