1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

Shell: Add a (very basic) formatter

This commit is contained in:
AnotherTest 2020-09-16 05:13:04 +04:30 committed by Andreas Kling
parent 6e6be8e56e
commit b3dd97a694
10 changed files with 1198 additions and 3 deletions

View file

@ -26,6 +26,7 @@
#include "Shell.h"
#include "Execution.h"
#include "Formatter.h"
#include <AK/Function.h>
#include <AK/LexicalPath.h>
#include <AK/ScopeGuard.h>
@ -449,6 +450,15 @@ bool Shell::invoke_function(const AST::Command& command, int& retval)
return true;
}
String Shell::format(const StringView& source, ssize_t& cursor) const
{
Formatter formatter(source, cursor);
auto result = formatter.format();
cursor = formatter.cursor();
return result;
}
Shell::Frame Shell::push_frame()
{
m_local_frames.empend();