Skip to content

Commit

Permalink
Improve prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jun 20, 2021
1 parent 06f5cef commit 4984e86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/repl/main.js
Expand Up @@ -7,14 +7,13 @@ import { defineCommands } from './commands/main.js'
import { setupHistory } from './history.js'
import { isMultiline, handleMultiline } from './multiline.js'
import { getOpts } from './options.js'
import { getPrompt } from './prompt.js'

// Starts a REPL that parses JavaScript code as input and prints their AST
export const repl = async function (opts) {
const { history, parseOpts, serializeOpts } = getOpts(opts)

const replServer = start({
prompt: getPrompt(serializeOpts),
prompt: PROMPT,
eval: evalCode.bind(undefined, parseOpts),
writer: serializeCode.bind(undefined, serializeOpts),
ignoreUndefined: true,
Expand All @@ -29,6 +28,9 @@ export const repl = async function (opts) {
return replServer
}

// REPL prompt
const PROMPT = '> '

// eslint-disable-next-line max-params
const evalCode = function (parseOpts, code, context, filename, func) {
// Entering nothing should be noop
Expand Down
9 changes: 0 additions & 9 deletions src/repl/prompt.js

This file was deleted.

0 comments on commit 4984e86

Please sign in to comment.