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

example from the website doesn't work as expected, invalid characters. #19

Open
BMaxV opened this issue Jun 23, 2024 · 2 comments
Open
Assignees

Comments

@BMaxV
Copy link

BMaxV commented Jun 23, 2024

There is an example rockstar script on the website https://codewithrockstar.com/

That goes like this:

Midnight takes your heart and your soul
While your heart is as high as your soul
Put your heart without your soul into your heart

Give back your heart


Desire is a lovestruck ladykiller
My world is nothing 
Fire is ice
Hate is water
Until my world is Desire,
Build my world up
If Midnight taking my world, Fire is nothing and Midnight taking my world, Hate is nothing
Shout "FizzBuzz!"
Take it to the top

If Midnight taking my world, Fire is nothing
Shout "Fizz!"
Take it to the top

If Midnight taking my world, Hate is nothing
Say "Buzz!"
Take it to the top

Whisper my world

which produces this output:

\m/
syntax error on line 13 at ,
invalid character on line 13 at ,
invalid character on line 13 at ,
fish: Job 2, './chirp example.rock' terminated by signal SIGSEGV (Address boundary error)

upon removing the "," it produces this:

\m/
syntax error on line 15 at Fire
invalid character on line 15 at Fire
invalid character on line 15 at is
invalid character on line 15 at is
invalid character on line 15 at nothing
invalid character on line 15 at and
invalid character on line 15 at taking
invalid character on line 15 at taking
invalid character on line 15 at Hate
FizzBuzz!
not valid statement
syntax error on line 19 at Fire
invalid character on line 19 at Fire
invalid character on line 19 at is
invalid character on line 19 at is
invalid character on line 19 at nothing
Fizz!
not valid statement
syntax error on line 23 at Hate
invalid character on line 23 at Hate
invalid character on line 23 at is
invalid character on line 23 at is
invalid character on line 23 at nothing
Buzz!
not valid statement
Segmentation fault (core dumped)

and I can't make a rhyme on why it would treat regular words or regular characters as invalid?

The examples included in the example folder seem to work fine though.

@Suloch
Copy link
Owner

Suloch commented Jun 26, 2024

Hi, thanks for reporting.
There are 2 things going wrong.

  1. The error due to comma at the end of line 13. It is different from rest of the commas as rest are being used for passing arguments but here this is just an extra.
  2. The and operation in conditional operation. I do not remember for sure. But, I believe some of the specs might have changed. Since in the implementation, the "and" keyword is being for list.

Solution:

  1. Ignore comma at the end of line
  2. Add conditional operations 'and' and 'or'

Both are not that difficult, but will require some time to fix. I will try to update as soon as I can.

@Suloch Suloch self-assigned this Jun 26, 2024
@BMaxV
Copy link
Author

BMaxV commented Jun 26, 2024

Super cool, thanks for the update!

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

2 participants