@@ -264,12 +264,11 @@ struct IPrivateMatcher {
264
264
};
265
265
266
266
/* *
267
- * matches PN_CHARS_BASE of the Turtle/SPARQL specification, without ASCII alpha (or with ASCIIAlphaMatcher).
267
+ * Matches the unicode part ( the characters listed as numbers) of PN_CHARS_BASE of the Turtle/SPARQL specification
268
268
*/
269
- struct PNCharsBase_UniMatcher {
269
+ struct PNCharsBase_UnicodePartMatcher {
270
270
[[nodiscard]] static constexpr bool match (int c) noexcept {
271
- return c == ' _' ||
272
- (c >= 0xC0 && c <= 0xD6 ) ||
271
+ return (c >= 0xC0 && c <= 0xD6 ) ||
273
272
(c >= 0xD8 && c <= 0xF6 ) ||
274
273
(c >= 0xF8 && c <= 0x02FF ) ||
275
274
(c >= 0x0370 && c <= 0x037D ) ||
@@ -296,12 +295,17 @@ struct PNCharsBase_UniMatcher {
296
295
/* *
297
296
* matches PN_CHARS_BASE of the Turtle/SPARQL specification
298
297
*/
299
- constexpr auto PNCharsBaseMatcher = ASCIIAlphaMatcher{} | PNCharsBase_UniMatcher {};
298
+ constexpr auto PNCharsBaseMatcher = ASCIIAlphaMatcher{} | PNCharsBase_UnicodePartMatcher {};
300
299
301
300
/* *
302
- * matches PN_CHARS of the Turtle/SPARQL specification, without ASCII num and PN_CHARS_BASE.
301
+ * matches PN_CHARS_U of the Turtle/SPARQL specificiation
303
302
*/
304
- struct PNChars_UniMatcher {
303
+ constexpr auto PNCharsUMatcher = ASCIIPatternMatcher{" _" } | PNCharsBaseMatcher;
304
+
305
+ /* *
306
+ * Matches the unicode part (the characters listed as numbers) of PN_CHARS of the Turtle/SPARQL specification
307
+ */
308
+ struct PNChars_UnicodePartMatcher {
305
309
[[nodiscard]] static constexpr bool match (int c) noexcept {
306
310
return c == 0xB7 ||
307
311
(c >= 0x0300 && c <= 0x036F ) ||
@@ -321,7 +325,7 @@ struct PNChars_UniMatcher {
321
325
/* *
322
326
* matches PN_CHARS of the Turtle/SPARQL specification.
323
327
*/
324
- constexpr auto PNCharsMatcher = ASCIINumMatcher{} | PNCharsBaseMatcher | PNChars_UniMatcher {};
328
+ constexpr auto PNCharsMatcher = ASCIINumMatcher{} | ASCIIPatternMatcher{ " - " } | PNCharsUMatcher | PNChars_UnicodePartMatcher {};
325
329
326
330
/* *
327
331
* iterates over s and tries to match all in m.
0 commit comments