rdflib 2.3.0-08f819ce → 2.3.0-ab7e9999

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/n3parser.js CHANGED
@@ -183,19 +183,9 @@ var ws = new RegExp("^[ \\t]*", 'g');
183
183
  var signed_integer = new RegExp("^[-+]?[0-9]+", 'g');
184
184
  var number_syntax = new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?([eE][-+]?[0-9]+)?", 'g');
185
185
  var datetime_syntax = new RegExp('^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?');
186
-
187
- // Reused in tight loops to detect whitespace or comment after a dot
188
- var wsOrHash = new RegExp("[\\s#]");
189
186
  var digitstring = new RegExp("^[0-9]+", 'g');
190
187
  var interesting = new RegExp("[\\\\\\r\\n\\\"]", 'g');
191
188
  var langcode = new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*", 'g');
192
-
193
- // Returns true when a dot at position i should terminate a name,
194
- // i.e., when the next character is whitespace, a comment start, or EOF
195
- function dotTerminatesName(str, i) {
196
- var next = str.charAt(i + 1);
197
- return next === '' || wsOrHash.test(next);
198
- }
199
189
  function createSinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why) {
200
190
  return new SinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why);
201
191
  }
@@ -685,14 +675,9 @@ export class SinkParser {
685
675
  throw BadSyntax(this._thisDoc, this.lines, str, i, "EOF when ']' expected after [ <propertyList>");
686
676
  }
687
677
  if (str.slice(j, j + 1) == ".") {
688
- // If a dot is found after a blank node, treat it as a statement terminator.
689
- // Do NOT consume the '.' here: statement terminators are handled centrally by
690
- // checkDot() (called by directiveOrStatement after statement()). Consuming the dot
691
- // locally would bypass that unified logic and could cause inconsistencies.
692
- // We do consume ']' below because it is a structural closer of the blank node,
693
- // not a statement terminator.
678
+ // If a dot is found after a blank node, treat it as statement terminator
694
679
  res.push(subj);
695
- return j; // leave '.' for checkDot()
680
+ return j;
696
681
  }
697
682
  if (str.slice(j, j + 1) != "]") {
698
683
  throw BadSyntax(this._thisDoc, this.lines, str, j, "']' expected");
@@ -1144,8 +1129,10 @@ export class SinkParser {
1144
1129
  var i = j;
1145
1130
  while (i < pyjslib_len(str)) {
1146
1131
  var c = str.charAt(i);
1132
+ // Allow dot in names unless it is followed by whitespace/comment/EOF
1147
1133
  if (c === '.') {
1148
- if (dotTerminatesName(str, i)) {
1134
+ var next = str.charAt(i + 1);
1135
+ if (next === '' || /[\s#]/.test(next)) {
1149
1136
  break; // treat as statement terminator, not part of name
1150
1137
  }
1151
1138
  // else: accept '.' as part of name
@@ -1178,8 +1165,10 @@ export class SinkParser {
1178
1165
  var i = i + 1;
1179
1166
  while (i < pyjslib_len(str)) {
1180
1167
  var c = str.charAt(i);
1168
+ // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1181
1169
  if (c === '.') {
1182
- if (dotTerminatesName(str, i)) {
1170
+ var next = str.charAt(i + 1);
1171
+ if (next === '' || /[\s#]/.test(next)) {
1183
1172
  break; // dot ends the name here
1184
1173
  }
1185
1174
  } else if (_notNameChars.indexOf(c) >= 0) {
@@ -1197,8 +1186,10 @@ export class SinkParser {
1197
1186
  var ln = "";
1198
1187
  while (i < pyjslib_len(str)) {
1199
1188
  var c = str.charAt(i);
1189
+ // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1200
1190
  if (c === '.') {
1201
- if (dotTerminatesName(str, i)) {
1191
+ var next = str.charAt(i + 1);
1192
+ if (next === '' || /[\s#]/.test(next)) {
1202
1193
  break; // dot ends the name here
1203
1194
  }
1204
1195
  } else if (_notNameChars.indexOf(c) >= 0) {
package/lib/n3parser.js CHANGED
@@ -191,19 +191,9 @@ var ws = new RegExp("^[ \\t]*", 'g');
191
191
  var signed_integer = new RegExp("^[-+]?[0-9]+", 'g');
192
192
  var number_syntax = new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?([eE][-+]?[0-9]+)?", 'g');
193
193
  var datetime_syntax = new RegExp('^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?');
194
-
195
- // Reused in tight loops to detect whitespace or comment after a dot
196
- var wsOrHash = new RegExp("[\\s#]");
197
194
  var digitstring = new RegExp("^[0-9]+", 'g');
198
195
  var interesting = new RegExp("[\\\\\\r\\n\\\"]", 'g');
199
196
  var langcode = new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*", 'g');
200
-
201
- // Returns true when a dot at position i should terminate a name,
202
- // i.e., when the next character is whitespace, a comment start, or EOF
203
- function dotTerminatesName(str, i) {
204
- var next = str.charAt(i + 1);
205
- return next === '' || wsOrHash.test(next);
206
- }
207
197
  function createSinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why) {
208
198
  return new SinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why);
209
199
  }
@@ -693,14 +683,9 @@ class SinkParser {
693
683
  throw BadSyntax(this._thisDoc, this.lines, str, i, "EOF when ']' expected after [ <propertyList>");
694
684
  }
695
685
  if (str.slice(j, j + 1) == ".") {
696
- // If a dot is found after a blank node, treat it as a statement terminator.
697
- // Do NOT consume the '.' here: statement terminators are handled centrally by
698
- // checkDot() (called by directiveOrStatement after statement()). Consuming the dot
699
- // locally would bypass that unified logic and could cause inconsistencies.
700
- // We do consume ']' below because it is a structural closer of the blank node,
701
- // not a statement terminator.
686
+ // If a dot is found after a blank node, treat it as statement terminator
702
687
  res.push(subj);
703
- return j; // leave '.' for checkDot()
688
+ return j;
704
689
  }
705
690
  if (str.slice(j, j + 1) != "]") {
706
691
  throw BadSyntax(this._thisDoc, this.lines, str, j, "']' expected");
@@ -1152,8 +1137,10 @@ class SinkParser {
1152
1137
  var i = j;
1153
1138
  while (i < pyjslib_len(str)) {
1154
1139
  var c = str.charAt(i);
1140
+ // Allow dot in names unless it is followed by whitespace/comment/EOF
1155
1141
  if (c === '.') {
1156
- if (dotTerminatesName(str, i)) {
1142
+ var next = str.charAt(i + 1);
1143
+ if (next === '' || /[\s#]/.test(next)) {
1157
1144
  break; // treat as statement terminator, not part of name
1158
1145
  }
1159
1146
  // else: accept '.' as part of name
@@ -1186,8 +1173,10 @@ class SinkParser {
1186
1173
  var i = i + 1;
1187
1174
  while (i < pyjslib_len(str)) {
1188
1175
  var c = str.charAt(i);
1176
+ // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1189
1177
  if (c === '.') {
1190
- if (dotTerminatesName(str, i)) {
1178
+ var next = str.charAt(i + 1);
1179
+ if (next === '' || /[\s#]/.test(next)) {
1191
1180
  break; // dot ends the name here
1192
1181
  }
1193
1182
  } else if (_notNameChars.indexOf(c) >= 0) {
@@ -1205,8 +1194,10 @@ class SinkParser {
1205
1194
  var ln = "";
1206
1195
  while (i < pyjslib_len(str)) {
1207
1196
  var c = str.charAt(i);
1197
+ // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1208
1198
  if (c === '.') {
1209
- if (dotTerminatesName(str, i)) {
1199
+ var next = str.charAt(i + 1);
1200
+ if (next === '' || /[\s#]/.test(next)) {
1210
1201
  break; // dot ends the name here
1211
1202
  }
1212
1203
  } else if (_notNameChars.indexOf(c) >= 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rdflib",
3
3
  "description": "an RDF library for node.js. Suitable for client and server side.",
4
- "version": "2.3.0-08f819ce",
4
+ "version": "2.3.0-ab7e9999",
5
5
  "private": false,
6
6
  "browserslist": [
7
7
  "> 0.5%"
package/src/n3parser.js CHANGED
@@ -212,20 +212,10 @@ var signed_integer = new RegExp("^[-+]?[0-9]+", 'g');
212
212
  var number_syntax = new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?([eE][-+]?[0-9]+)?", 'g');
213
213
  var datetime_syntax = new RegExp('^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?');
214
214
 
215
- // Reused in tight loops to detect whitespace or comment after a dot
216
- var wsOrHash = new RegExp("[\\s#]");
217
-
218
215
  var digitstring = new RegExp("^[0-9]+", 'g');
219
216
  var interesting = new RegExp("[\\\\\\r\\n\\\"]", 'g');
220
217
  var langcode = new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*", 'g');
221
218
 
222
- // Returns true when a dot at position i should terminate a name,
223
- // i.e., when the next character is whitespace, a comment start, or EOF
224
- function dotTerminatesName(str, i) {
225
- var next = str.charAt(i + 1);
226
- return next === '' || wsOrHash.test(next);
227
- }
228
-
229
219
  function createSinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why) {
230
220
  return new SinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why);
231
221
  }
@@ -749,14 +739,9 @@ export class SinkParser {
749
739
  throw BadSyntax(this._thisDoc, this.lines, str, i, "EOF when ']' expected after [ <propertyList>");
750
740
  }
751
741
  if ((str.slice( j, ( j + 1 ) ) == ".")) {
752
- // If a dot is found after a blank node, treat it as a statement terminator.
753
- // Do NOT consume the '.' here: statement terminators are handled centrally by
754
- // checkDot() (called by directiveOrStatement after statement()). Consuming the dot
755
- // locally would bypass that unified logic and could cause inconsistencies.
756
- // We do consume ']' below because it is a structural closer of the blank node,
757
- // not a statement terminator.
742
+ // If a dot is found after a blank node, treat it as statement terminator
758
743
  res.push(subj);
759
- return j; // leave '.' for checkDot()
744
+ return j;
760
745
  }
761
746
  if ((str.slice( j, ( j + 1 ) ) != "]")) {
762
747
  throw BadSyntax(this._thisDoc, this.lines, str, j, "']' expected");
@@ -1225,8 +1210,10 @@ export class SinkParser {
1225
1210
  var i = j;
1226
1211
  while ((i < pyjslib_len(str))) {
1227
1212
  var c = str.charAt(i);
1213
+ // Allow dot in names unless it is followed by whitespace/comment/EOF
1228
1214
  if (c === '.') {
1229
- if (dotTerminatesName(str, i)) {
1215
+ var next = str.charAt(i + 1);
1216
+ if (next === '' || /[\s#]/.test(next)) {
1230
1217
  break; // treat as statement terminator, not part of name
1231
1218
  }
1232
1219
  // else: accept '.' as part of name
@@ -1260,8 +1247,10 @@ export class SinkParser {
1260
1247
  var i = ( i + 1 ) ;
1261
1248
  while ((i < pyjslib_len(str))) {
1262
1249
  var c = str.charAt(i);
1250
+ // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1263
1251
  if (c === '.') {
1264
- if (dotTerminatesName(str, i)) {
1252
+ var next = str.charAt(i + 1);
1253
+ if (next === '' || /[\s#]/.test(next)) {
1265
1254
  break; // dot ends the name here
1266
1255
  }
1267
1256
  } else if (_notNameChars.indexOf(c) >= 0) {
@@ -1280,8 +1269,10 @@ export class SinkParser {
1280
1269
  var ln = "";
1281
1270
  while ((i < pyjslib_len(str))) {
1282
1271
  var c = str.charAt(i);
1272
+ // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1283
1273
  if (c === '.') {
1284
- if (dotTerminatesName(str, i)) {
1274
+ var next = str.charAt(i + 1);
1275
+ if (next === '' || /[\s#]/.test(next)) {
1285
1276
  break; // dot ends the name here
1286
1277
  }
1287
1278
  } else if (_notNameChars.indexOf(c) >= 0) {