@retorquere/bibtex-parser 6.4.6 → 6.4.8

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.
Files changed (3) hide show
  1. package/grammar.js +23 -15
  2. package/index.js +1 -0
  3. package/package.json +16 -16
package/grammar.js CHANGED
@@ -1,4 +1,4 @@
1
- // Generated by Peggy 2.0.1.
1
+ // Generated by Peggy 3.0.0.
2
2
  //
3
3
  // https://peggyjs.org/
4
4
 
@@ -45,16 +45,19 @@ peg$SyntaxError.prototype.format = function(sources) {
45
45
  }
46
46
  }
47
47
  var s = this.location.start;
48
- var loc = this.location.source + ":" + s.line + ":" + s.column;
48
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
49
+ ? this.location.source.offset(s)
50
+ : s;
51
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
49
52
  if (src) {
50
53
  var e = this.location.end;
51
- var filler = peg$padEnd("", s.line.toString().length, ' ');
54
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
52
55
  var line = src[s.line - 1];
53
56
  var last = s.line === e.line ? e.column : line.length + 1;
54
57
  var hatLen = (last - s.column) || 1;
55
58
  str += "\n --> " + loc + "\n"
56
59
  + filler + " |\n"
57
- + s.line + " | " + line + "\n"
60
+ + offset_s.line + " | " + line + "\n"
58
61
  + filler + " | " + peg$padEnd("", s.column - 1, ' ')
59
62
  + peg$padEnd("", hatLen, "^");
60
63
  } else {
@@ -503,14 +506,14 @@ function peg$parse(input, options) {
503
506
  }
504
507
  }
505
508
  };
506
- var peg$f35 = function(mark, char) {
509
+ var peg$f35 = function(mark, chr) {
507
510
  return {
508
511
  kind: 'DiacriticCommand',
509
512
  loc: location(),
510
513
  source: text(),
511
514
  mark: mark,
512
- dotless: !!char[1],
513
- character: char[1] || char[0],
515
+ dotless: !!chr[1],
516
+ character: chr[1] || chr[0],
514
517
  }
515
518
  };
516
519
  var peg$f36 = function(v) {
@@ -611,24 +614,24 @@ function peg$parse(input, options) {
611
614
  value: v,
612
615
  }
613
616
  };
614
- var peg$f46 = function(mark, char) {
617
+ var peg$f46 = function(mark, chr) {
615
618
  return {
616
619
  kind: 'DiacriticCommand',
617
620
  loc: location(),
618
621
  source: text(),
619
622
  mark: mark,
620
- dotless: !!char[1],
621
- character: char[1] || char[0],
623
+ dotless: !!chr[1],
624
+ character: chr[1] || chr[0],
622
625
  }
623
626
  };
624
- var peg$f47 = function(mark, char) {
627
+ var peg$f47 = function(mark, chr) {
625
628
  return {
626
629
  kind: 'DiacriticCommand',
627
630
  loc: location(),
628
631
  source: text(),
629
632
  mark: mark,
630
- dotless: !!char[1],
631
- character: char[1] || char[0],
633
+ dotless: !!chr[1],
634
+ character: chr[1] || chr[0],
632
635
  }
633
636
  };
634
637
  var peg$f48 = function(mark, v) {
@@ -909,11 +912,11 @@ function peg$parse(input, options) {
909
912
  }
910
913
  }
911
914
 
912
- function peg$computeLocation(startPos, endPos) {
915
+ function peg$computeLocation(startPos, endPos, offset) {
913
916
  var startPosDetails = peg$computePosDetails(startPos);
914
917
  var endPosDetails = peg$computePosDetails(endPos);
915
918
 
916
- return {
919
+ var res = {
917
920
  source: peg$source,
918
921
  start: {
919
922
  offset: startPos,
@@ -926,6 +929,11 @@ function peg$parse(input, options) {
926
929
  column: endPosDetails.column
927
930
  }
928
931
  };
932
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
933
+ res.start = peg$source.offset(res.start);
934
+ res.end = peg$source.offset(res.end);
935
+ }
936
+ return res;
929
937
  }
930
938
 
931
939
  function peg$fail(expected) {
package/index.js CHANGED
@@ -216,6 +216,7 @@ exports.fields = {
216
216
  'eprint',
217
217
  'file',
218
218
  'files',
219
+ 'pdf',
219
220
  'groups',
220
221
  'ids',
221
222
  'url',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retorquere/bibtex-parser",
3
- "version": "6.4.6",
3
+ "version": "6.4.8",
4
4
  "description": "BibTeX parser",
5
5
  "main": "index.js",
6
6
  "typings": "./index.d.ts",
@@ -36,31 +36,31 @@
36
36
  "author": "Emiliano Heyns",
37
37
  "license": "ISC",
38
38
  "devDependencies": {
39
- "@microsoft/api-documenter": "^7.19.27",
40
- "@microsoft/api-extractor": "^7.33.7",
41
- "@types/node": "^18.11.18",
42
- "@typescript-eslint/eslint-plugin": "^5.48.1",
43
- "@typescript-eslint/parser": "^5.48.1",
39
+ "@microsoft/api-documenter": "^7.21.5",
40
+ "@microsoft/api-extractor": "^7.34.4",
41
+ "@types/node": "^18.14.1",
42
+ "@typescript-eslint/eslint-plugin": "^5.53.0",
43
+ "@typescript-eslint/parser": "^5.53.0",
44
44
  "command-line-args": "^5.2.1",
45
- "csv": "^6.2.5",
45
+ "csv": "^6.2.7",
46
46
  "digital-tree": "^2.0.4",
47
47
  "ejs": "^3.1.8",
48
- "eslint": "^8.31.0",
49
- "eslint-plugin-import": "^2.27.4",
48
+ "eslint": "^8.35.0",
49
+ "eslint-plugin-import": "^2.27.5",
50
50
  "eslint-plugin-prefer-arrow": "^1.2.3",
51
- "glob": "^8.0.3",
52
- "mkdirp": "^1.0.4",
51
+ "glob": "^8.1.0",
52
+ "mkdirp": "^2.1.3",
53
53
  "node-fetch": "^3.3.0",
54
- "peggy": "^2.0.1",
54
+ "peggy": "^3.0.0",
55
55
  "piscina": "^3.2.0",
56
56
  "slug": "^8.2.2",
57
- "tap": "^16.3.3",
57
+ "tap": "^16.3.4",
58
58
  "ts-node": "^10.9.1",
59
- "tslib": "^2.4.1",
60
- "typescript": "^4.9.4"
59
+ "tslib": "^2.5.0",
60
+ "typescript": "^4.9.5"
61
61
  },
62
62
  "dependencies": {
63
- "unicode2latex": "^3.0.0",
63
+ "unicode2latex": "^3.0.1",
64
64
  "xregexp": "^5.1.1"
65
65
  },
66
66
  "files": [