diff options
author | David Robillard <d@drobilla.net> | 2022-12-20 07:23:10 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-12-20 07:32:13 -0500 |
commit | 58045c2ef18cc7912cb712a7c806d5f28fde187a (patch) | |
tree | 31860131ff102af5438fb199b52151d712566f1e /src | |
parent | 9757f30ad4d9bc1ceb7bb731b19872921f168e59 (diff) | |
download | serd-58045c2ef18cc7912cb712a7c806d5f28fde187a.tar.gz serd-58045c2ef18cc7912cb712a7c806d5f28fde187a.tar.bz2 serd-58045c2ef18cc7912cb712a7c806d5f28fde187a.zip |
Avoid using ASCII grave as a quote
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 30 | ||||
-rw-r--r-- | src/node.c | 12 | ||||
-rw-r--r-- | src/reader.h | 2 | ||||
-rw-r--r-- | src/serdi.c | 2 | ||||
-rw-r--r-- | src/uri.c | 6 | ||||
-rw-r--r-- | src/writer.c | 2 |
6 files changed, 27 insertions, 27 deletions
@@ -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; @@ -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; } @@ -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); |