@unified-latex/unified-latex-util-argspec
Advanced tools
Comparing version 1.2.2 to 1.3.0
13
index.js
@@ -21,3 +21,4 @@ // libs/argspec-parser.ts | ||
let spec = decorators; | ||
switch (node.type) { | ||
const type = node.type; | ||
switch (type) { | ||
case "body": | ||
@@ -52,7 +53,9 @@ return decorators + "b"; | ||
return spec + "{" + printRaw(node.content) + "}"; | ||
case "until": { | ||
const stopTokens = printRaw(node.stopTokens); | ||
return stopTokens.length > 1 || stopTokens[0] === " " ? `u{${stopTokens}}` : `u${stopTokens}`; | ||
} | ||
default: | ||
console.warn( | ||
`Unknown node type "${node.type}" for node`, | ||
node | ||
); | ||
const neverType = type; | ||
console.warn(`Unknown node type "${neverType}" for node`, node); | ||
return ""; | ||
@@ -59,0 +62,0 @@ } |
export type Ast = Node[] | Node; | ||
export type Node = Optional | Mandatory | Verbatim | Body | Group | string; | ||
export type Node = Optional | Mandatory | Verbatim | Body | Group | Until | string; | ||
type Optional = OptionalArg | OptionalStar | OptionalToken | Embellishment; | ||
@@ -44,3 +44,7 @@ interface AstNode { | ||
} | ||
interface Until extends AstNode { | ||
type: "until"; | ||
stopTokens: string[]; | ||
} | ||
export {}; | ||
//# sourceMappingURL=argspec-types.d.ts.map |
{ | ||
"name": "@unified-latex/unified-latex-util-argspec", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Tools parsing a LaTeX argument specification in the xparse format", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@unified-latex/unified-latex-util-pegjs": "^1.2.2" | ||
"@unified-latex/unified-latex-util-pegjs": "^1.3.0" | ||
}, | ||
@@ -11,0 +11,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
25516
243