aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-17 16:01:17 +0000
committerDavid Robillard <d@drobilla.net>2012-07-17 16:01:17 +0000
commit79dc6df5c5535569cee81a3f71c79642c4a3309f (patch)
tree9e05636e844bb723d2f3a9631d8808e8a2e44cb5
parent6fc8a337afad525989fe607832be968e0e681651 (diff)
downloadserd-79dc6df5c5535569cee81a3f71c79642c4a3309f.tar.gz
serd-79dc6df5c5535569cee81a3f71c79642c4a3309f.tar.bz2
serd-79dc6df5c5535569cee81a3f71c79642c4a3309f.zip
Support digits at start of local names as per new grammar.
git-svn-id: http://svn.drobilla.net/serd/trunk@360 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r--NEWS1
-rw-r--r--src/reader.c2
-rw-r--r--tests/test-digit-start-pname.out1
-rw-r--r--tests/test-digit-start-pname.ttl3
4 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 53ba478b..3c9dd6e5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
serd (9999) unstable;
+ * Support digits at start of local names as per new grammar
* Add incremental read interface suitable for reading from infinite streams
* Add -e option to serdi to use incremental reading
* Reset indent when finishing a write
diff --git a/src/reader.c b/src/reader.c
index d66dbb09..ac9d3778 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -685,7 +685,7 @@ static inline uchar
read_nameStartChar(SerdReader* reader)
{
const uint8_t c = peek_byte(reader);
- if (c == '_' || is_alpha(c)) { // TODO: not strictly correct
+ if (c == '_' || is_alpha(c) || is_digit(c)) { // TODO: Not correct
return eat_byte_safe(reader, c);
}
return 0;
diff --git a/tests/test-digit-start-pname.out b/tests/test-digit-start-pname.out
new file mode 100644
index 00000000..66eab7db
--- /dev/null
+++ b/tests/test-digit-start-pname.out
@@ -0,0 +1 @@
+<http://example.org/1thing> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
diff --git a/tests/test-digit-start-pname.ttl b/tests/test-digit-start-pname.ttl
new file mode 100644
index 00000000..6ca8ade8
--- /dev/null
+++ b/tests/test-digit-start-pname.ttl
@@ -0,0 +1,3 @@
+@prefix eg: <http://example.org/> .
+
+eg:1thing a eg:Thing . \ No newline at end of file