From 0dd3ed0c5967220ffd95cb3b2a7aa2b834b20a88 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 15 Jul 2023 15:14:17 -0700 Subject: [PATCH] Tignten up direction part of LANGDIR terminal. --- etc/n-triples.ebnf | 2 +- lib/rdf/ntriples/reader.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/n-triples.ebnf b/etc/n-triples.ebnf index 1fb58a05..4414263e 100644 --- a/etc/n-triples.ebnf +++ b/etc/n-triples.ebnf @@ -10,7 +10,7 @@ quotedTriple ::= '<<' subject predicate object '>>' IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>' BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)? -LANGDIR ::= "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* ('--' ('ltr'|'rtl'))?` +LANGDIR ::= "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* ('--' [a-zA-Z]+)?` STRING_LITERAL_QUOTE ::= '"' ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* '"' UCHAR ::= ( "\u" HEX HEX HEX HEX ) | ( "\U" HEX HEX HEX HEX HEX HEX HEX HEX ) diff --git a/lib/rdf/ntriples/reader.rb b/lib/rdf/ntriples/reader.rb index f6edde4d..b2641062 100644 --- a/lib/rdf/ntriples/reader.rb +++ b/lib/rdf/ntriples/reader.rb @@ -67,7 +67,7 @@ class Reader < RDF::Reader IRIREF = /<((?:#{IRI_RANGE}|#{UCHAR})*)>/.freeze BLANK_NODE_LABEL = /_:((?:[0-9]|#{PN_CHARS_U})(?:(?:#{PN_CHARS}|\.)*#{PN_CHARS})?)/.freeze - LANGDIR = /@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*(?:--[a-zA-Z0-9]+)?)/.freeze + LANGDIR = /@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*(?:--[a-zA-Z]+)?)/.freeze STRING_LITERAL_QUOTE = /"((?:[^\"\\\n\r]|#{ECHAR}|#{UCHAR})*)"/.freeze ST_START = /^<