popcodeorg / popcodeorg/popcode

Handle multi-line statements in the console

Open
#1,264 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
191
Forks
143
Avg merge
4d 11h
Merged PRs (30d)
5

Description

If a student types the following into the console and presses Enter:

if (name === "Pop") {

The console should recognize that it is an incomplete statement, and allow the student to keep typing (with an expanded input area to accommodate the new line).

This seems hard—how do we distinguish between an incomplete multiline statement and a statement that is syntactically invalid for some other reason? Perhaps Esprima or one of our other linters/parsers throws a specific “unexpected end of input” type error that we can rely on.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the console input handling and how its parser or linter reports an unexpected end of input for the example statement. Determine how incomplete input can be distinguished from other syntax errors and how the input area expands for continued lines. Done means the example can continue across lines while genuinely invalid statements still report errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.