struct Novika::Capabilities::ISystem::PromptConfig

Overview

A thin wrapper around the prompt configuration block of readLine*.

Defined in:

novika/capabilities/system.cr

Constant Summary

DELIMITERS = Word.new("delimiters")
HISTORY = Word.new("history")
MORE = Word.new("more?")
PROMPT = Word.new("prompt")
SUGGEST = Word.new("suggest")

Constructors

Instance Method Summary

Constructor Detail

def self.new(carrier : Block) #

Instance Method Detail

def delimiters? : Quote | Nil #

Returns word delimiter quote, if any. The decision of how to interpret the returned quote is up to the caller.


def history_entry? : Entry | Nil #

Returns the history entry in the carrier block, if any.


def more?(expression : String) : Form | Nil #

Returns false or nil if no more input is expected after expression, otherwise, returns some form that the user assigned "more" to or that they left on top of the stack (interpreted as true).


def prompt?(line_number : Int32) : Quote | Nil #

Returns the prompt quote for the given line_number, or nil if no prompt should be used.


def suggest?(word : String, prior : String) : Tuple(Quote, Block) | Nil #

Returns the title quote followed by suggestions block for the given word and input prior to word.