aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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