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

Create better example #7

Open
lunchboxav opened this issue Oct 1, 2021 · 9 comments
Open

Create better example #7

lunchboxav opened this issue Oct 1, 2021 · 9 comments
Labels

Comments

@lunchboxav
Copy link
Owner

We need to have a more thorough example. Some ideas that I can think of:

  1. A single entry point with full introduction of a story
  2. Option to go to 2 different page, that also have a story
  3. Example of action that may go to more than 2 pages

Pls checkout the current example and see what can be expanded

@atmorojo
Copy link
Contributor

Hello, I'm trying to add new examples to cover this issue but I got these error:

warning: `wayang-rs` (bin "wayang-rs") generated 2 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/wayang-rs`
thread 'main' panicked at 'Unsuccessful parse: Error { variant: ParsingError { positives: [item], negatives: [] }, 
location: Pos(115), line_col: Pos((4, 89)), path: None, line: "You forked this project. You check the available 
issues to see what can you do to help. There are engine related issues, default presentation issues, and 
documentation issues.␊", continued_line: None }', src/main.rs:114:63
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm still at my early journey in learning Rust so I guess I need some time to work on this. But I guess this is a parser related problem? I'll read more about pest and play around with the wyg.pest file to understand the problem better. Any hints to fix this would be appreciated.

Thank you

@lunchboxav
Copy link
Owner Author

Hi @atmorojo thank you very much for looking into this project. Yes, you're correct, it's an error related to the parser itself. If you want, you can try pest's playground here https://pest.rs/#editor, copy the wyg.pest as grammar and play with the input, based on one of the examples.

Though, after trying to compile wayang in a new machine, I also found another error happening. Maybe I should also update the grammar file.

Btw, did you manage to run the project on your machine? i.e run cargo run?

@lunchboxav
Copy link
Owner Author

@atmorojo if you have trouble in running the example, you can check for the line ending format on your IDE. Right now, using LF should fix this. See: https://github.com/lunchboxav/wayang-rs#file-format

@atmorojo
Copy link
Contributor

@lunchboxav I managed to run it before I made my own .wyg files. And it compiled to .html just fine. After I added my .wyg files and got some errors, I tried to move the problematic file to another directory and it compiled some of my .wyg files, just to find another problematic files later.

I guess mine is LF by default since I'm using Linux.

@lunchboxav
Copy link
Owner Author

Ah I see. If so, if you want, you can try post your .wyg file here so I can take a look at what's wrong. There could well be cases where I should improve the grammar file.

@atmorojo
Copy link
Contributor

This is one of the problematic files:
example_contribute.txt

(renamed the file's extension)

Thank you for patiently dealing with this. I think this project has a huge potential. In my case, I want to make a DnD style educational interactive fiction stories for children.

@lunchboxav
Copy link
Owner Author

Ah thank you very much. I will take a look at the file. At a glance it looks like it should be working, but will test it and update you, once I'm back in front of laptop 🙂

@lunchboxav
Copy link
Owner Author

@atmorojo thank you very much for your example. I founded that I have uncovered case in my parsing grammar. If you're wondering, you can take a look at this d2dffb0#diff-cda4c2797fb820b674e3d56dc1d5c99d7876b6351508798895f7bf69776b02f3

Now your example works 🙌 Thank you very much for pointing out where the code can be improved.

@atmorojo
Copy link
Contributor

I see now why it didn't work. Now it works perfectly! Thank you!

@atmorojo atmorojo mentioned this issue Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants