Skip to content

Commit 2af5e05

Browse files
committed
chore: fix lint and coverage errors
1 parent d27b920 commit 2af5e05

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/N3Parser.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export default class N3Parser {
372372
return this._readBlankNodeTail(token);
373373
}
374374
else if (this._contextStack.length > 1 && this._contextStack[this._contextStack.length - 2].type === '<<') {
375-
return this._error('Compound blank node expressions not permitted within quoted triples', token);
375+
return this._error('Compound blank node expressions not permitted within quoted triple', token);
376376
}
377377
else {
378378
this._predicate = null;
@@ -639,8 +639,6 @@ export default class N3Parser {
639639
if (!this._supportsRDFStar)
640640
return this._error('Unexpected RDF* syntax', token);
641641

642-
// TODO: Have error handling behavior here
643-
// TODO: See if we can just emit and then save null context
644642
this._saveContext('{|', this._graph, this._subject, this._predicate, this._object);
645643

646644
// Note - we always use the default graph for the quoted triple component
@@ -909,7 +907,8 @@ export default class N3Parser {
909907
this._predicate = null;
910908
this._object = null;
911909
return this._readPredicate;
912-
} else {
910+
}
911+
else {
913912
this._emit(this._subject, this._predicate, this._object, this._graph);
914913
}
915914

test/N3Parser-test.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,21 @@ describe('Parser', () => {
11261126
shouldParse('<d> <e> <<<<<a> <b> <c>>> <f> <g>>>.',
11271127
['d', 'e', [['a', 'b', 'c'], 'f', 'g']]));
11281128

1129+
it('should not parse compound blank node inside quoted triple subject',
1130+
shouldNotParse('<< [ <x> <y> ] <a> <b> >> <c> <d>.',
1131+
'Compound blank node expressions not permitted within quoted triple on line 1.'
1132+
));
1133+
1134+
it('should not parse compound blank node inside quoted triple predicate',
1135+
shouldNotParse('<< <a> [ <x> <y> ] <b> >> <c> <d>.',
1136+
'Disallowed blank node as predicate on line 1.'
1137+
));
1138+
1139+
it('should not parse compound blank node inside quoted triple object',
1140+
shouldNotParse('<< <a> <b> [ <x> <y> ] >> <c> <d>.',
1141+
'Compound blank node expressions not permitted within quoted triple on line 1.'
1142+
));
1143+
11291144
it('should not parse empty list inside quoted triple subject',
11301145
shouldNotParse('<< () <a> <b> >> <c> <d>.',
11311146
'Unexpected list inside quoted triple on line 1.'
@@ -1244,12 +1259,6 @@ describe('Parser', () => {
12441259
[['a', 'b', 'c'], 'd', 'e'],
12451260
[['a', 'b', 'c'], 'f', 'g']));
12461261

1247-
// TODO: See if this is required by the spec tests
1248-
// it('should parse an explicit triple with reified annotation containing punctuation',
1249-
// shouldParse('<a> <b> <c> {| <d> <e> . |} .',
1250-
// ['a', 'b', 'c'],
1251-
// [['a', 'b', 'c'], 'd', 'e']));
1252-
12531262
it('should parse an explicit triple with reified annotation in a named graph',
12541263
shouldParse('<G> { <a> <b> <c> {| <d> <e> |} . }',
12551264
['a', 'b', 'c', 'G'],

0 commit comments

Comments
 (0)