pest-parser / site Goto Github PK
View Code? Open in Web Editor NEWThis repo contains the source code for https://pest.rs
Home Page: http://pest.rs/
License: Apache License 2.0
This repo contains the source code for https://pest.rs
Home Page: http://pest.rs/
License: Apache License 2.0
Reproduction:
Should be an easy fix for someone with the time and code familiarity :)
Typing in code into the boxes under "Editor" (the "Try it Here!" button) does nothing.
In both FF & Chrome, it seems like some Rust in WASM is panicking:
Finished loading Rust wasm module 'pest_site'
pest-site.wasm:0x569b6 Uncaught RuntimeError: unreachable
at __rust_start_panic (pest-site.wasm:0x569b6)
at rust_panic (pest-site.wasm:0x567a6)
at std::panicking::rust_panic_with_hook::h51f1c855dfa04d94 (pest-site.wasm:0x564bd)
at std::panicking::continue_panic_fmt::h728aed66c815f8d0 (pest-site.wasm:0x56385)
at rust_begin_unwind (pest-site.wasm:0x56309)
at core::panicking::panic_fmt::h59066e1e00f1980f (pest-site.wasm:0x58faa)
at core::panicking::panic::h2629fd904a66558c (pest-site.wasm:0x58ed2)
at pest_site::parse_input::h8ebf157918e4c235 (pest-site.wasm:0x86cd)
at stdweb::webapi::window_or_worker::funcall_adapter::h0353d924de912f2e (pest-site.wasm:0x2e16)
at Object.Module.STDWEB_PRIVATE.dyncall (pest-site.js:425)
Hello,
I am red-green colourblind, and finding the red dashed underline that indicates an error in the online editor is quite difficult. A different colour, such as a bright yellow, would be much easier to spot; alternatively, a thicker line or brighter shade would also be an improvement in terms of accessibility.
The pest_debugger core functionality has been extracted to a standalone crate that could be used in frontends other than a command line. It will be cool to have something like regex101 for pest.
As of now, it seems that files are manually being uploaded to https://github.com/pest-parser/pest-parser.github.io. Github, however, already has the ability to turn repositories into github pages. Given that pest also has a domain, it's safe to assume the .github.io link is archivable and github actions can be used on here instead to build and deploy the webpage.
There are complaints about the performance comparison diagram used on the pest.rs site.
It should be edited; for example, the bars can be broken at the beginning (example), or it can just start at 0ms instead of 20ms to avoid over-emphasizing the difference. Additionally, special nom version that partially parses data (see the linked article above) should be included.
The blank editor is hard to get started with. It would be useful to show/list several example grammars, and be able to put them into the editor to have something to start playing around.
upd: the website Editor should try to pick the semantically top-level rule instead of the first in an alphabetically sorted order, or if it's not possible, at least do this for the example from the homepage
Or maybe the easier option is to just document that the user needs to select the general rule manually
Describe the bug
I was trying out the example from the home page and instead of getting the error mentioned there got a working - alpha: "a"
To Reproduce
alpha = { 'a'..'z' | 'A'..'Z' }
digit = { '0'..'9' }
ident = { (alpha | digit)+ }
ident_list = _{ !digit ~ ident ~ (" " ~ ident)+ }
// ^
// ident_list rule is silent (produces no tokens or error reports)
ab *
Expected behavior
Get the error message
thread 'main' panicked at ' --> 1:1
|
1 | ab *
| ^---
|
= expected ident', src/main.rs:12
Actual behavior
Happy parsing outcome - alpha: "a"
Additional context
The website seems to be missing a licence file. Is it also under MIT/Apache like the main pest repo?
Guys, pest.rs seems to be unreachable again.
I'm trying to open https://pest.rs in Chromium (Version 72.0.3626.7 (Developer Build) built on Debian buster/sid, running on Debian buster/sid (64-bit)). This never succeeds. The tab hangs and consumes 200% CPU according to the Chromium task manager. I cannot acquire a backtrace because it appears that the Chromium debugger cannot interrupt the loop it is stuck in, for some reason.
Unless I missed something the online editor does support labels (introduced by version 2.6.1) but does not show them in the result window.
It would be really nice to add support for them as it would help newcomers like me create better grammars without the need to add unneeded rules.
Book
), named Play
.If we agree that, I can do it.
The Share button for the online editor depends on myjson.com, but it appears that that service has been discontinued.
(Raising as an issue as this repository doesn't have discussions)
If instead of https://pest.rs/book, the book was located at https://book.pest.rs, we can seperate the build steps from the book and the site separately, allowing the book repo to contain its own CI/CD pipeline rather than relying on site.
put a unicode character in the input and click "Copy share link"
the error log will show:
[Error] InvalidCharacterError: The string contains invalid characters.
btoa (index.bb963137.js:1:19493)
(anonymous function) (index.bb963137.js:1:19493)
(anonymous function) (index.bb963137.js:1:19615)
Describe the bug
using the editor on pest.rs I found a bug in the formater that creates an invalid schema
To Reproduce
Here is the link to the editor, clicking on format moves the closing }
on the number
rule into a comment.
https://pest.rs/?g=N4Ig5gTghgtjURALhAdQBIEkAqBRAygAoCCAwrgAQC8FA%2BsBQBQA6IFrFAPuyM8wC4duAOVyoAMplEBKCgF9mAOyUA3KABsArgFMKe-dQoNGAewBGAK20BjflwoJoAT3sBnfhACWisPY877ADMNV11uRU11dVkFRXMrWwM9GgZWYA4APyZ4m35aAAcoTwgKLJYQABpMihzbAqKIaQAqaQB%2BUp4FNljavMLiwwZ3Lx8O1iRqtS1dWMcoFyTBngBtSY0AstYqtiypnWaxkABdDliImDNtEqSUpQNWAFpWdqyKAHo3ildPMGVFPXKAAYhBQAOQARlBADooaCAJygjrEfCkTCYWgAEUwAHEcC0OuUodVkaj0VjcdgWi89B8KIFoLZPCY-npWLhWJxWNpquUANQgx6sNqlElozE4vHvT7aAAe%2BWZ2kUgkUsX8ukWS1YatOSmC6lCGpSPD1oR1igiUQ1mpAFvUZqUw28vit%2BhoABJUrw%2BLwdhRvIorrRHaMsqw%2BGHukp-YHg86DDQAAIMaMQIMeJ20awACwQTXkUfNMfTPkzOZKNCMd30AEJyuGffYw%2BGhUjhABNKvcJv1gndhtdr09gdvAUgMyjwKj5RsAcQUeCEDSTs8Zs81iaYkosXoXAADXFFOAABY5EuVUpKiBvPlNPxkCB0v99KwA%2B4neMjDwUzVLLkP8A5HkKon1ZEAoH%2BOYnA-ZZwShABWCoKDVRDbUQ8FtAeAA2I5gPuEBYwoAB3Tx%2BCzChtFcawoHybQABMKFokxNDMdRdAAR00Ex%2BAojgkBXb0OM8awAGsKDMCATEI-5AhMGUeO9MMVRAOQgA#editor
Or here is the un-formated input.
WHITESPACE = _{ (" " | "\t" | NEWLINE) }
value = { (object | array | string | true | false | null) }
object = { "{" ~ (object_pair ~ ("," ~ object_pair)*)? ~ "}" }
object_pair = { string ~ ":" ~ value }
array = { "[" ~ value ~ ("," ~ value)* ~ "]" }
number = {
"-"? ~ // sign
("0" | '1'..'9' ~ ASCII_DIGIT*) ~ ("." ~ ASCII_DIGIT*)? ~ // fraction
"E"|"e" ~ ("+" | "-")? ~ASCII_DIGIT* // exponent
}
true = { "true" }
false = { "false" }
null = { "null" }
string = ${ "\"" ~ inner_string ~ "\"" }
inner_string = @{ inner_string_char* }
inner_string_char = {
!("\"" | "\\") ~ ANY
| "\\" ~ ("\"" | "\\" | "/" | "b" | "f" | "n" | "r" | "t")
| "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})
}
Expected behavior
Running format should not change the semantics of the source
This site is Pest's public face, and currently loads quickly and performs well. In an effort to keep it that way, we should be mindful about how much extra JavaScript, CSS, etc. we ask Pest's users (or prospective users) to download.
"Historical" site sizes can be checked by checking out and building old versions of the site. Alternatively, if we can set up our publishing process to use Releases, we can save each build and see site size trivially.
If we want to set hard limits to the site size, we might consider adopting a tool like bundlesize to catch any unexpectedly large changes in site size.
The online editor at pest.rs is a amazing feature for me. It allowed me to:
The request I have is to have a button/page to make it full screen. (I have currently hacked the boxes in firefox to give me more room.). If easy - then maybe make the boxes resizable (often the rules can be made smaller - as I am focusing on a small subset of the whole grammar.
Why:
Thank you for Pest - I love it!
It only lists two competitors, and only one of those is in the parser family. Benchmarks against more of the common parsers like combine and lalrpop would also be useful.
Pest is the listed as the slowest solution, with barely any explanation as to how it could be better. Making excuses for why they run faster is a weak argument; highlighting Pest's strengths is a lot better.
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.