aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-23 07:54:33 +0000
committerDavid Robillard <d@drobilla.net>2011-01-23 07:54:33 +0000
commita3c9e1dacb76cf0282d8419fa13a41d322046e60 (patch)
treeab46bd50bbf51994ab9779c698ebc35efa16aa01
parent983c964a11919f68f62d0a2193204789c27dc99c (diff)
downloadserd-a3c9e1dacb76cf0282d8419fa13a41d322046e60.tar.gz
serd-a3c9e1dacb76cf0282d8419fa13a41d322046e60.tar.bz2
serd-a3c9e1dacb76cf0282d8419fa13a41d322046e60.zip
Test language tags with hyphens.
Remove unused reader->err. git-svn-id: http://svn.drobilla.net/serd/trunk@42 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r--src/reader.c10
-rw-r--r--tests/test-lang.out1
-rw-r--r--tests/test-lang.ttl1
3 files changed, 4 insertions, 8 deletions
diff --git a/src/reader.c b/src/reader.c
index 057775c8..1c7f6f1c 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -99,7 +99,6 @@ error(SerdReader reader, const char* fmt, ...)
fprintf(stderr, "error: %s:%u:%u: ",
reader->cur.filename, reader->cur.line, reader->cur.col);
vfprintf(stderr, fmt, args);
- reader->err = 1;
return 0;
}
@@ -795,10 +794,6 @@ read_qname(SerdReader reader)
TRY_THROW(eat_byte(reader, ':'));
push_byte(reader, prefix, ':');
Ref str = read_name(reader, prefix, false);
- if (reader->err) {
- pop_string(reader, prefix);
- return 0;
- }
return str ? str : prefix;
except:
pop_string(reader, prefix);
@@ -1315,10 +1310,10 @@ read_statement(SerdReader reader)
static bool
read_turtleDoc(SerdReader reader)
{
- while (!reader->err && !reader->eof) {
+ while (!reader->eof) {
TRY_RET(read_statement(reader));
}
- return !reader->err;
+ return true;
}
SERD_API
@@ -1341,7 +1336,6 @@ serd_reader_new(SerdSyntax syntax,
reader->stack = serd_stack_new(STACK_PAGE_SIZE);
reader->cur = cur;
reader->next_id = 1;
- reader->err = 0;
reader->read_buf = (uint8_t*)malloc(READ_BUF_LEN * 2);
reader->read_head = 0;
reader->eof = false;
diff --git a/tests/test-lang.out b/tests/test-lang.out
index 76761505..a75749b0 100644
--- a/tests/test-lang.out
+++ b/tests/test-lang.out
@@ -1,2 +1,3 @@
<http://example.org/test-lang#thing> <http://example.org/test-lang#greeting> "Hello"@en .
+<http://example.org/test-lang#thing> <http://example.org/test-lang#greeting> "Howdy"@en-us .
<http://example.org/test-lang#thing> <http://example.org/test-lang#greeting> "Bonjour"@fr .
diff --git a/tests/test-lang.ttl b/tests/test-lang.ttl
index 407cc6e6..a4a6c77f 100644
--- a/tests/test-lang.ttl
+++ b/tests/test-lang.ttl
@@ -1,4 +1,5 @@
@prefix : <http://example.org/test-lang#> .
:thing :greeting "Hello"@en ;
+ :greeting "Howdy"@en-us ;
:greeting "Bonjour"@fr .