peggyjs / peggy-tag Goto Github PK
View Code? Open in Web Editor NEWTagged template strings for Peggy grammars
License: MIT License
Tagged template strings for Peggy grammars
License: MIT License
I just discovered peggyjs. Really nice work!
This peggy-tag
library plays a similar role to my pegjs-template library for PEG.js. I'd love to contribute the features from that library to this one. In particular, I'd be interested in contributing:
I've found these features quite useful in my own work. What do you think; do these feel like a good fit for peggy-tag
?
With the PR about to drop, line numbers will be correct from this code:
import peggy from "peggy-tag";
const parse123 = peggy`foo = $("f" "o"+)`;
console.log(parse123("foooo")); // "foooo"
but column numbers for errors thrown from the last line will be off by three. Find a way to determine where "foooo"
actually starts.
ava
.@sanket143 can you take a look at this please, to see if it's more-or-less what you wanted, and to see if there's anything that can be improved?
It would be nice if peggy.GrammarError.format
supported line and column offsets so that errors could be formatted with the CallSite of the place where the template originated. This will work in node, and possibly in v8-based browsers with the trick from stack-trace
.
This probably means ts+terser+rollup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.