Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would be nice to have an online playground #385

Open
mingodad opened this issue Jan 18, 2023 · 8 comments
Open

Would be nice to have an online playground #385

mingodad opened this issue Jan 18, 2023 · 8 comments

Comments

@mingodad
Copy link

Would be nice to have an online playground with nimbleparse like:

@ratmice
Copy link
Collaborator

ratmice commented Jan 18, 2023

This is also what ratmice/nimbleparse_lsp#6 is about, my original plan there of porting the lsp to a vscode web-extension has turned out to be a fairly difficult though, there is a project using the same underlying lsp library which does run on monaco so that might be a faster way forward.

@mingodad
Copy link
Author

I was thinking in something like:

#[no_mangle]
pub extern "C" fn lrpar_main(yacc_src: &str, lex_src: &str, input: &str, quiet: bool, recoverykind_str: &str, yacckind_str: &str) -> str {
}

As an exported function from nimbleparse that way we could have plyaground with only one exported function where all output is buffered and returned as String.

@ltratt
Copy link
Member

ltratt commented Jan 18, 2023

If someone wanted to host such a thing, that would be fine, but I won't be able to host myself, I'm afraid.

@mingodad
Copy link
Author

mingodad commented Jan 18, 2023

@ltratt
Copy link
Member

ltratt commented Jan 18, 2023

If someone wanted to make a PR to do so I'm game!

@mingodad
Copy link
Author

I could try but I'm not familiar with rust if you could implement:

#[no_mangle]
pub extern "C" fn lrpar_main(yacc_src: &str, lex_src: &str, input: &str, quiet: bool, recoverykind_str: &str, yacckind_str: &str) -> str {
}

Then I could try to create/adapt the Javascript/Html needed to host the playground on github pages.

@ltratt
Copy link
Member

ltratt commented Jan 18, 2023

This is, effectively, what cargo run --release --bin nimbleparse does:

$ cargo run --release --bin nimbleparse
    Finished release [optimized] target(s) in 0.05s
     Running `target/release/nimbleparse`
Too few arguments given.
Usage: nimbleparse [-r <cpctplus|none>] [-y <eco|grmtools|original>] [-q] <lexer.l> <parser.y> <input file>

So maybe that's enough as-is?

@mingodad
Copy link
Author

It would be if there was a way to create a virtual filesystem like it's possible with emscripten but I didn't found anything like that for rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants