MCPcopy Create free account
hub / github.com/Bananymous/banan-os / main_loop

Method main_loop

userspace/programs/Shell/TokenParser.cpp:784–811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784bool TokenParser::main_loop(bool break_on_error)
785{
786 for (;;)
787 {
788 auto opt_input = m_input_function({});
789 if (!opt_input.has_value())
790 break;
791
792 auto tokenized_input = tokenize_string(opt_input.release_value());
793 if (tokenized_input.is_error())
794 {
795 fprintf(stderr, "banan-sh: %s\n", tokenized_input.error().get_message());
796 if (break_on_error)
797 return false;
798 continue;
799 }
800
801 if (auto ret = run(tokenized_input.release_value()); ret.is_error())
802 {
803 fprintf(stderr, "banan-sh: %s\n", ret.error().get_message());
804 if (break_on_error)
805 return false;
806 continue;
807 }
808 }
809
810 return true;
811}

Callers 2

source_scriptMethod · 0.80
mainFunction · 0.80

Calls 8

tokenize_stringFunction · 0.85
fprintfFunction · 0.85
runFunction · 0.85
get_messageMethod · 0.80
errorMethod · 0.80
has_valueMethod · 0.45
release_valueMethod · 0.45
is_errorMethod · 0.45

Tested by

no test coverage detected