Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@unified-latex/unified-latex-util-pegjs
Advanced tools
PEGjs grammars and tools for constructing unified-latex ASTs
Pegjs grammars to help parse strings into a unified-latex
Abstract Syntax Tree (AST). Note,
because of the dynamic nature of LaTeX, to get a full AST with arguments attached to macros, etc.,
the tree is parsed multiple times.
Also included are functions to decorate a Ast.Node[]
array so that Pegjs can process it as if it were
a string. This allows for complex second-pass parsing.
If you are building libraries to parse specific LaTeX syntax (e.g., to parse tabular
environments or
systeme
environments, etc.).
npm install @unified-latex/unified-latex-util-pegjs
This package contains both esm and commonjs exports. To explicitly access the esm export,
import the .js
file. To explicitly access the commonjs export, import the .cjs
file.
decorateArrayForPegjs(array)
Pegjs operates on strings. However, strings and arrays are very similar!
This function adds charAt
, charCodeAt
, and substring
methods to
array
so that array
can then be fed to a Pegjs generated parser.
function decorateArrayForPegjs(array: any[]): StringlikeArray;
Parameters
Param | Type |
---|---|
array | any[] |
splitStringsIntoSingleChars(nodes)
Splits all multi-character strings into strings that are all single characters.
function splitStringsIntoSingleChars(nodes: Ast.Node[]): Ast.Node[];
Parameters
Param | Type |
---|---|
nodes | Ast.Node[] |
v1.7.0
vite
. Should result in smaller bundles.{signature: "O{foo}"}
. The defaults are substituted in when expanding the macros with the optional arguments omitted.parse
, but never during a parseMinimal
, comments are modified to remove leading whitespace. Previously, modified comments would have their position information deleted. Position information is now preserved.)FAQs
PEGjs grammars and tools for constructing unified-latex ASTs
The npm package @unified-latex/unified-latex-util-pegjs receives a total of 3,117 weekly downloads. As such, @unified-latex/unified-latex-util-pegjs popularity was classified as popular.
We found that @unified-latex/unified-latex-util-pegjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.