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

Runtime error when is only debug flags in the code #32

Closed
Wheatwizard opened this issue Aug 9, 2016 · 1 comment
Closed

Runtime error when is only debug flags in the code #32

Wheatwizard opened this issue Aug 9, 2016 · 1 comment
Labels

Comments

@Wheatwizard
Copy link
Collaborator

If you try to run code with only debug flags and no braces (e.g. #dl) you get the following runtime error:

/Users/eamon/projects/Brain-Flak/stack.rb:51:in `include?': no implicit conversion of nil into String (TypeError)
    from /Users/eamon/projects/Brain-Flak/stack.rb:51:in `is_opening_bracket?'
    from /Users/eamon/projects/Brain-Flak/Interpreter.rb:135:in `step'
    from brain_flak.rb:60:in `<main>'

This error occurs when the interpreter attempts to determine if the program starts with an opening bracket but discovers there is no program. It passes a nil object to the method is_opening_bracket, which then tries to convert that to a string. This error occurs on both the debug-flag-dev and master branches. This error only occurs with debug mode on.

@Wheatwizard Wheatwizard added the bug label Aug 9, 2016
Wheatwizard pushed a commit that referenced this issue Aug 9, 2016
@Wheatwizard
Copy link
Collaborator Author

After commit 434b1a8 a program containing only debug flags no longer throws a runtime exception but rather a brain-flak error. It throws our good friend the Error at character 1: Invalid character ''..

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

1 participant