paperlint 4.1.0 → 4.2.0
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/CLAUDE.md +24 -0
- package/CONTRIBUTING.md +7 -0
- package/dist/adapters/latex/document-class.d.ts +6 -5
- package/dist/adapters/latex/document-class.d.ts.map +1 -1
- package/dist/adapters/latex/document-class.js +18 -10
- package/dist/adapters/latex/document-class.js.map +1 -1
- package/dist/adapters/latex/includes.d.ts +12 -0
- package/dist/adapters/latex/includes.d.ts.map +1 -0
- package/dist/adapters/latex/includes.js +42 -0
- package/dist/adapters/latex/includes.js.map +1 -0
- package/dist/adapters/latex/index.d.ts +9 -5
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +8 -1
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/nodes.d.ts +5 -1
- package/dist/adapters/latex/nodes.d.ts.map +1 -1
- package/dist/adapters/latex/nodes.js +6 -2
- package/dist/adapters/latex/nodes.js.map +1 -1
- package/dist/adapters/latex/parse.d.ts.map +1 -1
- package/dist/adapters/latex/parse.js +1 -0
- package/dist/adapters/latex/parse.js.map +1 -1
- package/dist/adapters/latex/prose.d.ts +8 -0
- package/dist/adapters/latex/prose.d.ts.map +1 -0
- package/dist/adapters/latex/prose.js +353 -0
- package/dist/adapters/latex/prose.js.map +1 -0
- package/dist/claim-provenance.d.ts +34 -0
- package/dist/claim-provenance.d.ts.map +1 -0
- package/dist/claim-provenance.js +146 -0
- package/dist/claim-provenance.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +20 -0
- package/dist/cli.js.map +1 -1
- package/dist/domain/paper-source.d.ts +58 -0
- package/dist/domain/paper-source.d.ts.map +1 -0
- package/dist/domain/paper-source.js +109 -0
- package/dist/domain/paper-source.js.map +1 -0
- package/dist/domain/sentences.d.ts +26 -0
- package/dist/domain/sentences.d.ts.map +1 -0
- package/dist/domain/sentences.js +48 -0
- package/dist/domain/sentences.js.map +1 -0
- package/dist/domain/tex-document.d.ts +39 -4
- package/dist/domain/tex-document.d.ts.map +1 -1
- package/dist/domain/tex-document.js.map +1 -1
- package/dist/eslint-rules/paper-typography.d.ts +7 -0
- package/dist/eslint-rules/paper-typography.d.ts.map +1 -1
- package/dist/eslint-rules/paper-typography.js +53 -1
- package/dist/eslint-rules/paper-typography.js.map +1 -1
- package/dist/ports/latex.d.ts +12 -1
- package/dist/ports/latex.d.ts.map +1 -1
- package/dist/register.d.ts +40 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +134 -0
- package/dist/register.js.map +1 -0
- package/dist/tex-paper.d.ts +19 -0
- package/dist/tex-paper.d.ts.map +1 -0
- package/dist/tex-paper.js +105 -0
- package/dist/tex-paper.js.map +1 -0
- package/dist/tex-venue-rules.d.ts +7 -2
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js +31 -17
- package/dist/tex-venue-rules.js.map +1 -1
- package/docs/rules/tex/claim-provenance.md +83 -0
- package/docs/rules/tex/missing-input.md +58 -0
- package/docs/rules/tex/register.md +77 -0
- package/docs/rules/tex/required-section.md +3 -1
- package/docs/rules/tex/template.md +12 -0
- package/docs/rules/tex/venue-leftover.md +4 -2
- package/docs/rules.md +3 -0
- package/eslint-rules/paper-typography.test.mjs +48 -1
- package/eslint-rules/paper-typography.ts +72 -1
- package/eslint.config.mjs +1 -0
- package/fixtures/real-markdown-paper/baseline.ts +8 -7
- package/package.json +2 -1
- package/skills/cold-read-diff/SKILL.md +31 -10
- package/skills/cold-read-diff/SKILL.md.spec.ts +30 -9
- package/skills/draft-paper/SKILL.md +2 -2
- package/skills/draft-paper/SKILL.md.spec.ts +1 -1
- package/skills/grade-paper-writing/SKILL.md +109 -44
- package/skills/grade-paper-writing/SKILL.md.spec.ts +108 -43
- package/skills/harden-paper/SKILL.md +35 -36
- package/skills/harden-paper/SKILL.md.spec.ts +34 -35
- package/skills/paper-adversarial-review/SKILL.md +2 -2
- package/skills/paper-adversarial-review/SKILL.md.spec.ts +1 -1
- package/skills/paper-pipeline/SKILL.md +3 -3
- package/skills/paper-pipeline/SKILL.md.spec.ts +2 -2
- package/skills/paper-pipeline/grade-paper-writing-ablation.eval.mjs +6 -6
- package/skills/paper-pipeline/references/writing-craft.md +53 -18
- package/skills/pc-panel-review/SKILL.md +36 -11
- package/skills/pc-panel-review/SKILL.md.spec.ts +35 -10
- package/src/adapters/latex/document-class.ts +20 -12
- package/src/adapters/latex/includes.ts +66 -0
- package/src/adapters/latex/index.test.ts +175 -1
- package/src/adapters/latex/index.ts +14 -4
- package/src/adapters/latex/nodes.ts +11 -2
- package/src/adapters/latex/parse.ts +1 -0
- package/src/adapters/latex/prose.ts +484 -0
- package/src/claim-provenance.test.ts +352 -0
- package/src/claim-provenance.ts +217 -0
- package/src/cli.ts +20 -0
- package/src/domain/paper-source.test.ts +156 -0
- package/src/domain/paper-source.ts +233 -0
- package/src/domain/sentences.ts +67 -0
- package/src/domain/tex-document.ts +36 -3
- package/src/ports/latex.ts +13 -0
- package/src/register.test.ts +165 -0
- package/src/register.ts +177 -0
- package/src/rule-cases.test.ts +54 -4
- package/src/tex-paper.test.ts +131 -0
- package/src/tex-paper.ts +152 -0
- package/src/tex-venue-rules.test.ts +87 -5
- package/src/tex-venue-rules.ts +62 -30
- package/skills/harden-paper/fixtures/uncited-assertions-sample.md +0 -43
- package/skills/harden-paper/fixtures/uncited-assertions-sample.tex +0 -77
package/CLAUDE.md
CHANGED
|
@@ -500,6 +500,30 @@ of the account-wide 3000/month shared with every other private repo, and the bud
|
|
|
500
500
|
private again, this section and `.github/dependabot.yml` are revisited together** — the bot is
|
|
501
501
|
justified two hundred lines above precisely by these minutes being free.
|
|
502
502
|
|
|
503
|
+
## Writing checks — what keeps them from pushing papers toward a blog post
|
|
504
|
+
|
|
505
|
+
The rules and skills that judge a paper's prose follow five principles. A new rule, or a new
|
|
506
|
+
criterion in a skill, is held to them.
|
|
507
|
+
|
|
508
|
+
1. **Every writing check is two-sided.** A check with only a ceiling — too long, too many markers,
|
|
509
|
+
too many of X — pushes every paper toward clipped, unsignposted prose, and the one equilibrium of
|
|
510
|
+
a set of ceilings is a blog post. A new check has a floor as well, or measures the distance to a
|
|
511
|
+
reference (accepted papers of the target venue); never only "less is better".
|
|
512
|
+
2. **Rules count, skills judge.** What is countable on the parse tree — a density, a number with no
|
|
513
|
+
owner (`tex/claim-provenance`), a missing section — is a lint rule. What needs reading — register
|
|
514
|
+
relative to a venue, genre, whether a claim changed strength — is a skill criterion. A skill does
|
|
515
|
+
not grep prose for what a rule can count; a rule is not asked to judge register.
|
|
516
|
+
3. **The model reader is the venue's reviewer, not only a smart outsider.** A check that simulates a
|
|
517
|
+
reader includes a skimming reviewer who reads the abstract, the introduction and the conclusion,
|
|
518
|
+
and judges whether it reads as a paper at that venue and whose result each sentence states.
|
|
519
|
+
4. **Thresholds are calibrated, not borrowed.** A threshold is set with the same counter on real
|
|
520
|
+
accepted papers, never taken from a published figure measured by a different counter. Those
|
|
521
|
+
papers are [`fixtures/accepted-papers/`](fixtures/accepted-papers/README.md), and every rule's
|
|
522
|
+
count on them is recorded there.
|
|
523
|
+
5. **A rewrite is accepted on what reviewers see.** That is the combined count of every surface form
|
|
524
|
+
of a tic (a narrow rule is gamed by rewording), plus a claims-preservation check that no claim was
|
|
525
|
+
softened or strengthened — not the one pattern the triggering rule matched.
|
|
526
|
+
|
|
503
527
|
## Testing
|
|
504
528
|
|
|
505
529
|
| you are testing | kind |
|
package/CONTRIBUTING.md
CHANGED
|
@@ -84,6 +84,13 @@ linking there. `src/rule-docs.test.ts` holds every rule the config registers to
|
|
|
84
84
|
older than the convention wait in its `AWAITING_PAGE` list, which only shrinks — #131 writes their
|
|
85
85
|
pages.
|
|
86
86
|
|
|
87
|
+
**A rule or a skill criterion that judges prose is two-sided.** A check that only caps something —
|
|
88
|
+
length, markers, hedges — drives papers toward clipped, unsignposted prose that reviewers call a
|
|
89
|
+
blog post, so a new one also has a floor, or measures the distance to accepted papers of the target
|
|
90
|
+
venue, with its threshold measured by the same counter on those papers. What the parse tree can
|
|
91
|
+
count is a rule; what needs reading (register, genre) is a skill criterion. The five principles are
|
|
92
|
+
in [`CLAUDE.md`](CLAUDE.md#writing-checks--what-keeps-them-from-pushing-papers-toward-a-blog-post).
|
|
93
|
+
|
|
87
94
|
## Maintainer docs
|
|
88
95
|
|
|
89
96
|
The README links only what a user needs. These are for people changing the package:
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { type ClassLine, type DocumentClass } from "../../domain/tex-document.ts";
|
|
3
3
|
import { type ParsedTex } from "./parse.ts";
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The `\documentclass` at the top of the tree: missing; empty (`\documentclass{}`); the class with
|
|
6
|
+
* each of its options as written (`foo={a,b}` stays one option, braces kept), whitespace collapsed,
|
|
7
|
+
* its place spanning the macro and its arguments; or, when there are several (behind a TeX switch),
|
|
8
|
+
* each of them as a candidate.
|
|
8
9
|
*/
|
|
9
10
|
export declare function documentClassOf(t: ParsedTex): ClassLine;
|
|
10
11
|
/**
|
|
@@ -15,8 +16,8 @@ export declare function parseTemplate(text: string): DocumentClass | null;
|
|
|
15
16
|
/**
|
|
16
17
|
* The source with its `\documentclass` line changed to satisfy `want` (see `venueClass`): another
|
|
17
18
|
* class is replaced by the template's line; the same class gains the options it lacks in place. A
|
|
18
|
-
* source whose class already satisfies `want`,
|
|
19
|
-
* returned as it is.
|
|
19
|
+
* source whose class already satisfies `want`, that has no class line the parser could place, or
|
|
20
|
+
* that has several, is returned as it is.
|
|
20
21
|
*/
|
|
21
22
|
export declare function replaceDocumentClass(t: ParsedTex, want: DocumentClass): string;
|
|
22
23
|
//# sourceMappingURL=document-class.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-class.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/document-class.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,
|
|
1
|
+
{"version":3,"file":"document-class.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/document-class.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAqDxD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,CAOvD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAShE;AA0BD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,EAAE,SAAS,EACZ,IAAI,EAAE,aAAa,GAClB,MAAM,CAqBR"}
|
|
@@ -24,7 +24,8 @@ function sourceOf(src, nodes) {
|
|
|
24
24
|
const optionText = (src, part) => collapse(splitWhere(part, (n) => n.type === "comment")
|
|
25
25
|
.map((run) => sourceOf(src, run))
|
|
26
26
|
.join(""));
|
|
27
|
-
|
|
27
|
+
/** Every `\documentclass` at the top of the tree, in source order. */
|
|
28
|
+
const classNodes = (t) => t.root.content.filter(isDocumentClass);
|
|
28
29
|
/** A `\documentclass` node as a class line: empty, or the class with its options as read. */
|
|
29
30
|
function classLine(src, node) {
|
|
30
31
|
const place = macroPlace(node);
|
|
@@ -37,13 +38,19 @@ function classLine(src, node) {
|
|
|
37
38
|
return { kind: "class", cls, options, place };
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
|
-
* The
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* The `\documentclass` at the top of the tree: missing; empty (`\documentclass{}`); the class with
|
|
42
|
+
* each of its options as written (`foo={a,b}` stays one option, braces kept), whitespace collapsed,
|
|
43
|
+
* its place spanning the macro and its arguments; or, when there are several (behind a TeX switch),
|
|
44
|
+
* each of them as a candidate.
|
|
43
45
|
*/
|
|
44
46
|
export function documentClassOf(t) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
+
const lines = classNodes(t).map((n) => classLine(t.src, n));
|
|
48
|
+
const [first, second, ...rest] = lines;
|
|
49
|
+
if (first === undefined)
|
|
50
|
+
return { kind: "missing" };
|
|
51
|
+
return second === undefined
|
|
52
|
+
? first
|
|
53
|
+
: { kind: "ambiguous", candidates: [first, second, ...rest] };
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
49
56
|
* A preset's `template` → the class it names: a whole `\documentclass[…]{…}` line, or a bare class
|
|
@@ -78,12 +85,13 @@ function addOptions(src, node, line, options) {
|
|
|
78
85
|
/**
|
|
79
86
|
* The source with its `\documentclass` line changed to satisfy `want` (see `venueClass`): another
|
|
80
87
|
* class is replaced by the template's line; the same class gains the options it lacks in place. A
|
|
81
|
-
* source whose class already satisfies `want`,
|
|
82
|
-
* returned as it is.
|
|
88
|
+
* source whose class already satisfies `want`, that has no class line the parser could place, or
|
|
89
|
+
* that has several, is returned as it is.
|
|
83
90
|
*/
|
|
84
91
|
export function replaceDocumentClass(t, want) {
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
// Several lines behind a switch: which one builds is not known, so none is rewritten.
|
|
93
|
+
const [node, ...others] = classNodes(t);
|
|
94
|
+
if (node === undefined || others.length > 0)
|
|
87
95
|
return t.src;
|
|
88
96
|
const line = classLine(t.src, node);
|
|
89
97
|
if (line.kind !== "class" || line.place.kind === "unplaced")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-class.js","sourceRoot":"","sources":["../../../src/adapters/latex/document-class.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EACL,iBAAiB,EACjB,UAAU,
|
|
1
|
+
{"version":3,"file":"document-class.js","sourceRoot":"","sources":["../../../src/adapters/latex/document-class.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EACL,iBAAiB,EACjB,UAAU,GAIX,MAAM,8BAA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,CAAC,CAAC,CAAC;IACxC,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,GAAG,CAAC;IAC1D,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACpC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,CAAC,CAAC,GAAG,CAAC;IAC1E,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACvC,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,CAAC,CAAC,GAAG,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACjE,KAAK,KAAK;YACR,OAAO,UAAU,CACf,CAAC,CAAC,GAAG,EACL,IAAI,EACJ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,EAC3C,MAAM,CAAC,OAAO,CACf,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Include } from "../../domain/paper-source.ts";
|
|
2
|
+
import type { Span } from "../../domain/tex-document.ts";
|
|
3
|
+
import type { ParsedTex } from "./parse.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Every `\input`, `\include` and `\subfile` of the source, in source order — not in a comment (a
|
|
6
|
+
* comment is a node of its own) and not in a macro definition's body, which is read where the macro
|
|
7
|
+
* is used, and nothing here expands macros.
|
|
8
|
+
*/
|
|
9
|
+
export declare const includesOf: (t: ParsedTex) => readonly Include[];
|
|
10
|
+
/** The span of the `document` environment's body, or null when the source has none. */
|
|
11
|
+
export declare const documentBodyOf: (t: ParsedTex) => Span | null;
|
|
12
|
+
//# sourceMappingURL=includes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAYzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA6B5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,SAAS,KAAG,SAAS,OAAO,EAGU,CAAC;AAKrE,uFAAuF;AACvF,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,KAAG,IAAI,GAAG,IAOhD,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isDefinition } from "./hidden.js";
|
|
2
|
+
import { inPlace, isNode, macroPlace, mandatory, placeOf, visited, } from "./nodes.js";
|
|
3
|
+
const INCLUDE_MACROS = new Map([
|
|
4
|
+
["input", "input"],
|
|
5
|
+
["include", "include"],
|
|
6
|
+
["subfile", "subfile"],
|
|
7
|
+
]);
|
|
8
|
+
/**
|
|
9
|
+
* The path an include names, as written: its braced argument, or — TeX's own form, `\input name` —
|
|
10
|
+
* the name up to the next space. unified-latex gives the unbraced form an argument of the first
|
|
11
|
+
* token only (`sections` of `sections/a`), so the source is read for it.
|
|
12
|
+
*/
|
|
13
|
+
function argumentText(src, m) {
|
|
14
|
+
const start = mandatory(m)[0]?.content[0]?.position?.start.offset;
|
|
15
|
+
if (start === undefined)
|
|
16
|
+
return null;
|
|
17
|
+
const rest = src.slice(start);
|
|
18
|
+
const stop = rest.search(src[start - 1] === "{" ? /\}/u : /[\s{}%]/u);
|
|
19
|
+
return stop < 0 ? rest : rest.slice(0, stop);
|
|
20
|
+
}
|
|
21
|
+
/** One include macro as an `Include`, or nothing when it names no file or has no place. */
|
|
22
|
+
function includeOf(src, m) {
|
|
23
|
+
const macro = INCLUDE_MACROS.get(m.content);
|
|
24
|
+
const target = argumentText(src, m);
|
|
25
|
+
if (macro === undefined || target === null || target.trim() === "")
|
|
26
|
+
return [];
|
|
27
|
+
return inPlace(macroPlace(m), (span) => [{ macro, target, span }]);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Every `\input`, `\include` and `\subfile` of the source, in source order — not in a comment (a
|
|
31
|
+
* comment is a node of its own) and not in a macro definition's body, which is read where the macro
|
|
32
|
+
* is used, and nothing here expands macros.
|
|
33
|
+
*/
|
|
34
|
+
export const includesOf = (t) => visited(t.root, isDefinition)
|
|
35
|
+
.filter(isNode)
|
|
36
|
+
.flatMap((n) => (n.type === "macro" ? includeOf(t.src, n) : []));
|
|
37
|
+
const isDocument = (n) => n.type === "environment" && n.env === "document";
|
|
38
|
+
/** The span of the `document` environment's body, or null when the source has none. */
|
|
39
|
+
export const documentBodyOf = (t) => (t.root.content.find(isDocument)?.content ?? [])
|
|
40
|
+
.flatMap((n) => inPlace(placeOf(n), (span) => [span]))
|
|
41
|
+
.reduce((body, span) => body === null ? span : { start: body.start, end: span.end }, null);
|
|
42
|
+
//# sourceMappingURL=includes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"includes.js","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,OAAO,GAGR,MAAM,YAAY,CAAC;AAGpB,MAAM,cAAc,GAA0C,IAAI,GAAG,CAAC;IACpE,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,S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C,CAAY,EAAsB,EAAE,CAC7D,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,YAAY,CAAC;KAC1B,MAAM,CAAC,MAAM,CAAC;KACd,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErE,MAAM,UAAU,GAAG,CAAC,CAAO,EAAkC,EAAE,CAC7D,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,CAAC,GAAG,KAAK,UAAU,CAAC;AAEnD,uFAAuF;AACvF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAY,EAAe,EAAE,CAC1D,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,IAAI,EAAE,CAAC;KAC7C,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;KACrD,MAAM,CACL,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CACb,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAC7D,IAAI,CACL,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Reads a paper.tex and answers
|
|
2
|
+
* Reads a paper.tex and answers four questions — checks nothing itself: `documentClassOf` (which
|
|
3
3
|
* class, with which options, and where), `outlineOf` (the sections in order, where the back matter
|
|
4
|
-
* starts, where the document ends)
|
|
5
|
-
* its source offset)
|
|
6
|
-
*
|
|
4
|
+
* starts, where the document ends), `renderedRuns` (the text a reader sees, each character with
|
|
5
|
+
* its source offset) and `bodyProse` (the body's prose as passages, with its citation and
|
|
6
|
+
* cross-reference marks). Used by `tex/template`, `tex/required-section`, `tex/venue-leftover`,
|
|
7
|
+
* `tex/claim-provenance` and `paperlint new`, through the `LatexReader` port (`src/ports/latex.ts`);
|
|
8
|
+
* `src/cli.ts` wires it.
|
|
7
9
|
*
|
|
8
10
|
* ── WHY THE PARSE TREE AND NOT THE `tex/latex` PROJECTION ────────────────────────
|
|
9
11
|
* The ESLint language's projection (`eslint-rules/latex-language.ts`) blanks the preamble,
|
|
@@ -20,9 +22,11 @@
|
|
|
20
22
|
*/
|
|
21
23
|
import type { LatexReader } from "../../ports/latex.ts";
|
|
22
24
|
export { documentClassOf, parseTemplate, replaceDocumentClass, } from "./document-class.ts";
|
|
23
|
-
export { collapse, macroPlace, mandatory, optional, placeOf, textOf, } from "./nodes.ts";
|
|
25
|
+
export { collapse, inPlace, macroPlace, mandatory, optional, placeOf, textOf, } from "./nodes.ts";
|
|
26
|
+
export { documentBodyOf, includesOf } from "./includes.ts";
|
|
24
27
|
export { outlineOf } from "./outline.ts";
|
|
25
28
|
export { parseLatex, type ParsedTex } from "./parse.ts";
|
|
29
|
+
export { bodyProse } from "./prose.ts";
|
|
26
30
|
export { renderedRuns } from "./rendered.ts";
|
|
27
31
|
/** The `LatexReader` port over unified-latex: each call parses its source once. */
|
|
28
32
|
export declare const latexReader: LatexReader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAYxD,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,mFAAmF;AACnF,eAAO,MAAM,WAAW,EAAE,WASzB,CAAC"}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { documentClassOf, parseTemplate, replaceDocumentClass, } from "./document-class.js";
|
|
2
|
+
import { documentBodyOf, includesOf } from "./includes.js";
|
|
2
3
|
import { outlineOf } from "./outline.js";
|
|
3
4
|
import { parseLatex } from "./parse.js";
|
|
5
|
+
import { bodyProse } from "./prose.js";
|
|
4
6
|
import { renderedRuns } from "./rendered.js";
|
|
5
7
|
export { documentClassOf, parseTemplate, replaceDocumentClass, } from "./document-class.js";
|
|
6
|
-
export { collapse, macroPlace, mandatory, optional, placeOf, textOf, } from "./nodes.js";
|
|
8
|
+
export { collapse, inPlace, macroPlace, mandatory, optional, placeOf, textOf, } from "./nodes.js";
|
|
9
|
+
export { documentBodyOf, includesOf } from "./includes.js";
|
|
7
10
|
export { outlineOf } from "./outline.js";
|
|
8
11
|
export { parseLatex } from "./parse.js";
|
|
12
|
+
export { bodyProse } from "./prose.js";
|
|
9
13
|
export { renderedRuns } from "./rendered.js";
|
|
10
14
|
/** The `LatexReader` port over unified-latex: each call parses its source once. */
|
|
11
15
|
export const latexReader = {
|
|
12
16
|
documentClass: (src) => documentClassOf(parseLatex(src)),
|
|
13
17
|
outline: (src) => outlineOf(parseLatex(src)),
|
|
14
18
|
renderedRuns: (src) => renderedRuns(parseLatex(src)),
|
|
19
|
+
bodyProse: (src) => bodyProse(parseLatex(src)),
|
|
20
|
+
includes: (src) => includesOf(parseLatex(src)),
|
|
21
|
+
documentBody: (src) => documentBodyOf(parseLatex(src)),
|
|
15
22
|
template: parseTemplate,
|
|
16
23
|
withDocumentClass: (src, want) => replaceDocumentClass(parseLatex(src), want),
|
|
17
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAkB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACxD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5C,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACpD,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9C,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9C,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtD,QAAQ,EAAE,aAAa;IACvB,iBAAiB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;CAC9E,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** What the three readers share about unified-latex nodes: places, text, and the walk. */
|
|
2
2
|
import type * as Ast from "@unified-latex/unified-latex-types";
|
|
3
|
-
import type { Place } from "../../domain/tex-document.ts";
|
|
3
|
+
import type { Place, Span } from "../../domain/tex-document.ts";
|
|
4
4
|
export { collapse } from "../../domain/tex-document.ts";
|
|
5
5
|
/** unified-latex's node types, read-only: nothing here writes to a tree. */
|
|
6
6
|
export type Node = Readonly<Ast.Node>;
|
|
@@ -19,6 +19,10 @@ interface Positioned {
|
|
|
19
19
|
}
|
|
20
20
|
/** Where a node stands, or that it has no position. */
|
|
21
21
|
export declare const placeOf: (n: Positioned) => Place;
|
|
22
|
+
/** What `f` makes of a place's span, or nothing for a node the parser gave no position. */
|
|
23
|
+
export declare const inPlace: <T>(p: Place, f: (span: Span) => readonly T[]) => readonly T[];
|
|
24
|
+
/** A macro's arguments, in order: none when the parser attached none. */
|
|
25
|
+
export declare const argumentsOf: (m: Macro) => readonly Argument[];
|
|
22
26
|
/** The first mandatory (`{…}`) and optional (`[…]`) arguments' contents, and the last mandatory one's. */
|
|
23
27
|
export declare const mandatory: (m: Macro) => readonly Argument[];
|
|
24
28
|
export declare const optional: (m: Macro) => Argument | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/nodes.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/nodes.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,4EAA4E;AAC5E,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtC,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACxC,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAE9C,uGAAuG;AACvG,UAAU,UAAU;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,KAAK,EAAE;YAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5C,QAAQ,CAAC,GAAG,EAAE;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IAAI,GAAG,QAAQ,CAAC,EACjD,CAAC;AAEnB,+CAA+C;AAC/C,eAAO,MAAM,UAAU,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,QACR,CAAC;AAEtC,mFAAmF;AACnF,eAAO,MAAM,MAAM,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,IACiB,CAAC"}
|
|
@@ -8,9 +8,13 @@ export const placeOf = (n) => n.position === undefined
|
|
|
8
8
|
kind: "at",
|
|
9
9
|
span: { start: n.position.start.offset, end: n.position.end.offset },
|
|
10
10
|
};
|
|
11
|
+
/** What `f` makes of a place's span, or nothing for a node the parser gave no position. */
|
|
12
|
+
export const inPlace = (p, f) => (p.kind === "at" ? f(p.span) : []);
|
|
13
|
+
/** A macro's arguments, in order: none when the parser attached none. */
|
|
14
|
+
export const argumentsOf = (m) => m.args ?? [];
|
|
11
15
|
/** The first mandatory (`{…}`) and optional (`[…]`) arguments' contents, and the last mandatory one's. */
|
|
12
|
-
export const mandatory = (m) => (m
|
|
13
|
-
export const optional = (m) => (m
|
|
16
|
+
export const mandatory = (m) => argumentsOf(m).filter((a) => a.openMark === "{");
|
|
17
|
+
export const optional = (m) => argumentsOf(m).find((a) => a.openMark === "[");
|
|
14
18
|
/** What a string node reads as: itself, except a tie (`~`), which is a space the reader sees. */
|
|
15
19
|
export const stringText = (content) => content === "~" ? " " : content;
|
|
16
20
|
const LAST = { kind: "argument", at: -1 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../../src/adapters/latex/nodes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAexD,uDAAuD;AACvD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAa,EAAS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C,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAU/D,oGAAoG;AACpG,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAgB9C,CAAC;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAU/D,oGAAoG;AACpG,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAgB9C,CAAC;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB9C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAGnD,CAAC;AAUH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAWhD,CAAC;AAOH,QAAA,MAAM,MAAM,eAAsB,CAAC;AAEnC,0GAA0G;AAC1G,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;IACxB,QAA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ACrD,GAAG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;IACzB,CAAC,MAAM,CAAC,EAAE,IAAI;CACf,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,MAAM,GAAG,CACb,KAAwB,EACxB,SAAiB,EAC+C,EAAE,CAClE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,CAAU,CAAC,CAAC;AAEhD,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IAC1D,MAAM;IACN,OAAO;IACP,OAAO;IACP,SAAS;IACT,SAAS;IACT,YAAY;IACZ,UAAU;IACV,aAAa;IACb,OAAO;IACP,OAAO;IACP,QAAQ;IACR,WAAW;IACX,UAAU;IACV,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAEvB,MAAM,CAAC,WAAW,CAAC;IACrB,GAAG,MAAM,CAAC,CAAC,GAAG,eAAe,CAAC,EAAE,OAAO,CAAC;IACxC,GAAG,MAAM,CACP;QACE,OAAO;QACP,KAAK;QACL,OAAO;QACP,SAAS;QACT,SAAS;QACT,MAAM;QACN,MAAM;QACN,KAAK;QACL,OAAO;QACP,SAAS;QACT,SAAS;QACT,cAAc;QACd,mBAAmB;QACnB,gBAAgB;KACjB,EACD,GAAG,CACJ;IACD,GAAG,MAAM,CAAC,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC;IACzC,GAAG,MAAM,CAAC,CAAC,YAAY,EAAE,gBAAgB,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC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IAAI,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;IACzB,CAAC,MAAM,CAAC,EAAE,IAAI;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Passage } from "../../domain/tex-document.ts";
|
|
2
|
+
import { type ParsedTex } from "./parse.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The body's prose, in document order: the content of the `document` environment (the whole
|
|
5
|
+
* source when there is none), up to the first back-matter node.
|
|
6
|
+
*/
|
|
7
|
+
export declare function bodyProse(t: ParsedTex): readonly Passage[];
|
|
8
|
+
//# sourceMappingURL=prose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prose.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/prose.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAS,OAAO,EAAc,MAAM,8BAA8B,CAAC;AAW/E,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AA6bhF;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,OAAO,EAAE,CAM1D"}
|