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

Repl Enhancements and Fixes #27

Open
6 of 7 tasks
melvic-ybanez opened this issue Oct 1, 2023 · 0 comments
Open
6 of 7 tasks

Repl Enhancements and Fixes #27

melvic-ybanez opened this issue Oct 1, 2023 · 0 comments

Comments

@melvic-ybanez
Copy link
Owner

melvic-ybanez commented Oct 1, 2023

  • Declared values should persist and be available in the environment for the next input
    • Let statements
    • Class declarations
    • Functions
  • Expressions should be evaluated directly and their results printed immediately
  • A script that ends in an expression (e.g. let x = 10; x) should evaluate the expression and print its result.
  • Errors that occur at the later stages of the interpreter pipeline should have higher priorities.
    dry> let x = 10;
    dry> let x = "";
    [line 1] Error at 'let': Expected 'expression' after (.
    [line 1] Error : Resolver Error: Variable x is already defined in this scope
    in the example above, the first error is not needed. A resolver error is more important since it indicates that the
    parser has already passed. The first error was caused by Dry's attempt to interpret the code as an expression first.
    Note: This issue does not occur when running dry scripts. It is just a by-product of the REPL's current
    implementation
    .
@melvic-ybanez melvic-ybanez changed the title Repl Enhancements Repl Enhancements and Fixes Oct 1, 2023
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

1 participant