ArkScript
A small, fast, functional and scripting language for video games
Ark::Repl Class Reference

#include <Repl.hpp>

+ Collaboration diagram for Ark::Repl:

Public Member Functions

 Repl (uint16_t options, const std::vector< std::string > &libenv)
 Construct a new Repl object. More...
 
int run ()
 Start the REPL. More...
 

Private Member Functions

void print_repl_header ()
 
int count_open_parentheses (const std::string &line)
 
int count_open_braces (const std::string &line)
 
void trim_whitespace (std::string &line)
 
void cui_setup ()
 

Private Attributes

uint16_t m_options
 
Replxx m_repl
 
unsigned m_lines
 
int m_old_ip
 
std::vector< std::string > m_libenv
 

Detailed Description

Definition at line 25 of file Repl.hpp.

Constructor & Destructor Documentation

◆ Repl()

Ark::Repl::Repl ( uint16_t  options,
const std::vector< std::string > &  libenv 
)

Construct a new Repl object.

Parameters
optionsthe REPL options
libenvsearch path for the std library

Definition at line 11 of file Repl.cpp.

Member Function Documentation

◆ count_open_braces()

int Ark::Repl::count_open_braces ( const std::string &  line)
private

Definition at line 135 of file Repl.cpp.

Referenced by run().

◆ count_open_parentheses()

int Ark::Repl::count_open_parentheses ( const std::string &  line)
private

Definition at line 119 of file Repl.cpp.

Referenced by run().

◆ cui_setup()

void Ark::Repl::cui_setup ( )
private

Definition at line 161 of file Repl.cpp.

References Ark::ColorsRegexDict, hook_color(), hook_completion(), hook_hint(), Ark::KeywordsDict, and m_repl.

Referenced by run().

◆ print_repl_header()

void Ark::Repl::print_repl_header ( )
inlineprivate

Definition at line 109 of file Repl.cpp.

References ARK_VERSION_MAJOR, ARK_VERSION_MINOR, and ARK_VERSION_PATCH.

Referenced by run().

◆ run()

◆ trim_whitespace()

void Ark::Repl::trim_whitespace ( std::string &  line)
private

Definition at line 151 of file Repl.cpp.

Referenced by run().

Member Data Documentation

◆ m_libenv

std::vector<std::string> Ark::Repl::m_libenv
private

Definition at line 47 of file Repl.hpp.

Referenced by run().

◆ m_lines

unsigned Ark::Repl::m_lines
private

Definition at line 45 of file Repl.hpp.

Referenced by run().

◆ m_old_ip

int Ark::Repl::m_old_ip
private

Definition at line 46 of file Repl.hpp.

Referenced by run().

◆ m_options

uint16_t Ark::Repl::m_options
private

Definition at line 43 of file Repl.hpp.

Referenced by run().

◆ m_repl

Replxx Ark::Repl::m_repl
private

Definition at line 44 of file Repl.hpp.

Referenced by cui_setup(), and run().


The documentation for this class was generated from the following files: