Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Mar 24, 2023
1 parent f32e2c3 commit f2a2fba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/N3Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,12 @@ export default class N3Parser {
if (!this._n3Mode)
return this._error('Unexpected literal', token);

// Regular literal, can still get a datatype or language
if (token.prefix.length === 0) {
this._literalValue = token.value;
return this._completeSubjectLiteral;
}
// Pre-datatyped string literal (prefix stores the datatype)
else
this._subject = this._literal(token.value, this._namedNode(token.prefix));

Expand Down Expand Up @@ -270,10 +272,12 @@ export default class N3Parser {
if (!this._n3Mode)
return this._error('Unexpected literal', token);

// Regular literal, can still get a datatype or language
if (token.prefix.length === 0) {
this._literalValue = token.value;
return this._completePredicateLiteral;
}
// Pre-datatyped string literal (prefix stores the datatype)
else
this._predicate = this._literal(token.value, this._namedNode(token.prefix));

Expand Down

0 comments on commit f2a2fba

Please sign in to comment.