
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@tonstudio/pgen
Advanced tools
Not only other parser generators for web weren't written here, but they lack a set of features we really need:
Not only other parser generators for web weren't written here, but they lack a set of features we really need:
any
/**/
, underscores in numbers 1_234
and other features that are nowhere represented in AST.A<B>
: duplicated code leads to increased chance to make a mistake, and high-order rules are required for duplication.pgen
mostly follows grammar of peggy with a few notable differences.
Foo = ...
create AST nodes with { $: 'Foo' }
.;
.{ return 42; }
are not supported. We can't infer types of AST when there is some inlined JavaScript code, because JS is untyped.A<B> = ...
were added.space
rule.#
was added.[a-z]i
.rule = ...;
Rule = ...
. Returns an object with { $: 'Rule', loc: Loc }
with rest of the fields defined with named clauses in right-hand side.Id "identifier" = ...;
inter<A, B> = ...;
and call inter<expression, ",">
"A" / "B"
. Will match the first matching clause.foo bar baz
. All clauses should match in sequence."if" "(" expr:expression ")" stmts:statements
. Sequence operator generates an object, and named clauses become its fields { expr: ..., stmts: ... }
."if" "(" @expression ")"
. Sequence operator returns only a single value of picked clause.a = b
. Works as a = @b
.!x
. Fails if x
matches. Doesn't consume input.&x
. Passes if x
matches. Doesn't consume input.$x
. Ignores AST computed by x, returns string that x
matched.#x
. Does not skip spaces inside of x
. If x
calls some other rules, doesn't skip spaces there either.x*
.x+
.x?
."abc"
.[a-z_]
. Supports ranges a-z
. Supports negation [^a-z]
."string"
, [a-z]
#x
#x
.FAQs
Not only other parser generators for web weren't written here, but they lack a set of features we really need:
The npm package @tonstudio/pgen receives a total of 45 weekly downloads. As such, @tonstudio/pgen popularity was classified as not popular.
We found that @tonstudio/pgen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.