Skip to content

[REPL]: Repl disallows multiline reads due to missing closing square bracket #2168

@RickBarretto

Description

@RickBarretto

Summary

I tried to reproduce an example with classes, but the REPL disallows me to keep writing the second line due to missing closing square bracket.

Current Behavior

When I try to write the second line, this happens:

$> define :queue [
..
══╡ Syntax Error ╞════════════════════════════════════════════════════════════════════════════════════════════ <repl> ══

  Unable to parse input code

  Issue found when trying to parse:
      Block

  Missing:
      closing square bracket (`]`)

$> nit

Expected Behavior

Obviously this will miss this closing bracket, at least for while, until I finish to write the whole class.
The desired behavior would be:

$> define :queue [ 
..     init: constructor [] 
..     ... 
..     ]

Closing pairs should be ignored on REPL when the end of my line is an empty space, which means that I have not finished to type and I want to continue on the next line.

Steps To Reproduce

  1. Open the REPL
  2. Try to write this example:
define :queue [
    init: method [][
        this\items: []            <----- INITIAL ASSIGNMENT
    ]

    enqueue: method [item][
        panic "enqueue must be implemented by concrete type"
    ]

    dequeue: method [][
        panic "dequeue must be implemented by concrete type" 
    ]
]

OS

Windows 11

Version

arturo v/0.9.84-beta b/3419.nightly.20251227 (amd64/windows)

Anything else?

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Labels

bugSomething isn't workingreplIssues related to the REPL

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions