@retorquere/bibtex-parser 6.4.11 → 6.4.13
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/grammar.js +11 -8
- package/index.js +33 -7
- package/package.json +12 -12
- package/unabbrev.json +31 -378
package/grammar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by Peggy 3.0.
|
|
1
|
+
// Generated by Peggy 3.0.2.
|
|
2
2
|
//
|
|
3
3
|
// https://peggyjs.org/
|
|
4
4
|
|
|
@@ -551,7 +551,7 @@ function peg$parse(input, options) {
|
|
|
551
551
|
if (leadingcmdblockarg && leadingcmdblockarg.case === 'protect') delete leadingcmdblockarg.case
|
|
552
552
|
|
|
553
553
|
// \sl, \it etc
|
|
554
|
-
if (markup[leadingcmd.command]) {
|
|
554
|
+
if (markup[leadingcmd.command] && leadingcmd.arguments.required.length === 0) {
|
|
555
555
|
block.markup[markup[leadingcmd.command]] = true
|
|
556
556
|
block.value.shift()
|
|
557
557
|
}
|
|
@@ -4150,15 +4150,18 @@ function peg$parse(input, options) {
|
|
|
4150
4150
|
}
|
|
4151
4151
|
if (s0 === peg$FAILED) {
|
|
4152
4152
|
s0 = peg$currPos;
|
|
4153
|
-
s1 = peg$
|
|
4154
|
-
|
|
4155
|
-
|
|
4153
|
+
s1 = peg$parse__h();
|
|
4154
|
+
s2 = peg$parseBlock();
|
|
4155
|
+
if (s2 === peg$FAILED) {
|
|
4156
|
+
s2 = peg$parseCommand();
|
|
4156
4157
|
}
|
|
4157
|
-
if (
|
|
4158
|
+
if (s2 !== peg$FAILED) {
|
|
4158
4159
|
peg$savedPos = s0;
|
|
4159
|
-
|
|
4160
|
+
s0 = peg$f64(s2);
|
|
4161
|
+
} else {
|
|
4162
|
+
peg$currPos = s0;
|
|
4163
|
+
s0 = peg$FAILED;
|
|
4160
4164
|
}
|
|
4161
|
-
s0 = s1;
|
|
4162
4165
|
}
|
|
4163
4166
|
|
|
4164
4167
|
return s0;
|
package/index.js
CHANGED
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.jabref = exports.chunker = exports.promises = exports.ast = exports.parse = exports.fields = exports.toSentenceCase = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
30
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
6
|
-
const bibtex =
|
|
7
|
-
const chunker =
|
|
31
|
+
const bibtex = __importStar(require("./grammar"));
|
|
32
|
+
const chunker = __importStar(require("./chunker"));
|
|
8
33
|
exports.chunker = chunker;
|
|
9
|
-
const jabref =
|
|
34
|
+
const jabref = __importStar(require("./jabref"));
|
|
10
35
|
exports.jabref = jabref;
|
|
11
36
|
const jabref_1 = require("./jabref");
|
|
12
37
|
const unicode2latex_1 = require("unicode2latex");
|
|
13
|
-
const crossref_json_1 =
|
|
14
|
-
const fields_json_1 =
|
|
15
|
-
const xregexp_1 =
|
|
38
|
+
const crossref_json_1 = __importDefault(require("./crossref.json"));
|
|
39
|
+
const fields_json_1 = __importDefault(require("./fields.json"));
|
|
40
|
+
const xregexp_1 = __importDefault(require("xregexp"));
|
|
16
41
|
function restore(text, orig, preserve) {
|
|
17
42
|
for (const { start, end } of preserve) {
|
|
18
43
|
text = text.substring(0, start) + orig.substring(start, end) + text.substring(end);
|
|
@@ -943,6 +968,7 @@ class Parser {
|
|
|
943
968
|
case 'cite':
|
|
944
969
|
case 'textsc':
|
|
945
970
|
case 'textbf':
|
|
971
|
+
case 'texttt':
|
|
946
972
|
case 'mkbibbold':
|
|
947
973
|
case 'section':
|
|
948
974
|
case 'subsection':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retorquere/bibtex-parser",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.13",
|
|
4
4
|
"description": "BibTeX parser",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
"author": "Emiliano Heyns",
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@microsoft/api-documenter": "^7.
|
|
40
|
-
"@microsoft/api-extractor": "^7.34.
|
|
41
|
-
"@types/node": "^18.
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
43
|
-
"@typescript-eslint/parser": "^5.
|
|
39
|
+
"@microsoft/api-documenter": "^7.22.3",
|
|
40
|
+
"@microsoft/api-extractor": "^7.34.7",
|
|
41
|
+
"@types/node": "^18.16.3",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
43
|
+
"@typescript-eslint/parser": "^5.59.2",
|
|
44
44
|
"command-line-args": "^5.2.1",
|
|
45
|
-
"csv": "^6.2.
|
|
45
|
+
"csv": "^6.2.11",
|
|
46
46
|
"digital-tree": "^2.0.4",
|
|
47
47
|
"ejs": "^3.1.9",
|
|
48
|
-
"eslint": "^8.
|
|
48
|
+
"eslint": "^8.39.0",
|
|
49
49
|
"eslint-plugin-import": "^2.27.5",
|
|
50
50
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
51
|
-
"glob": "^
|
|
52
|
-
"mkdirp": "^
|
|
51
|
+
"glob": "^10.2.2",
|
|
52
|
+
"mkdirp": "^3.0.1",
|
|
53
53
|
"node-fetch": "^3.3.1",
|
|
54
|
-
"peggy": "^3.0.
|
|
54
|
+
"peggy": "^3.0.2",
|
|
55
55
|
"piscina": "^3.2.0",
|
|
56
56
|
"slug": "^8.2.2",
|
|
57
57
|
"tap": "^16.3.4",
|
|
58
58
|
"ts-node": "^10.9.1",
|
|
59
59
|
"tslib": "^2.5.0",
|
|
60
|
-
"typescript": "^
|
|
60
|
+
"typescript": "^5.0.4"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"unicode2latex": "^3.0.3",
|