Revert #113 because of incompatibility with the workshop

This commit is contained in:
Laury
2022-03-23 22:07:20 +01:00
parent e2598031c8
commit 7e64124ddc
7 changed files with 10 additions and 32 deletions

View File

@@ -5,8 +5,8 @@
namespace Code {
/* Record: | Size | Name | Body |
* Script: | | | Status | CursorPosition | Content |
/* Record: | Size | Name | Body |
* Script: | | | Status | Content |
*
*
* |FetchedForVariableBoxBit
@@ -23,9 +23,7 @@ namespace Code {
* FetchedForVariableBoxBit is used to prevent circular importation problems,
* such as scriptA importing scriptB, which imports scriptA. Once we get the
* variables from a script to put them in the variable box, we switch the bit to
* 1 and won't reload it afterwards.
*
* Cursor Position is two bytes long and has the cursor position value */
* 1 and won't reload it afterwards. */
class Script : public Ion::Storage::Record {
private:
@@ -35,7 +33,6 @@ private:
// See the comment at the beginning of the file
static constexpr size_t k_statusSize = 1;
static constexpr size_t k_cursorPositionSize = 2;
public:
static constexpr int k_defaultScriptNameMaxSize = 6 + k_defaultScriptNameNumberMaxSize + 1;
@@ -46,16 +43,13 @@ public:
static bool DefaultName(char buffer[], size_t bufferSize);
static bool nameCompliant(const char * name);
static constexpr size_t StatusSize() { return k_statusSize; }
static constexpr size_t CursorPositionSize() { return k_cursorPositionSize; }
Script(Ion::Storage::Record r = Ion::Storage::Record()) : Record(r) {}
bool autoImportationStatus() const;
void toggleAutoimportationStatus();
const char * content() const;
size_t contentSize() { return value().size - k_statusSize - k_cursorPositionSize; }
void setCursorPosition(uint16_t position);
uint16_t * CursorPosition();
size_t contentSize() { return value().size - k_statusSize; }
/* Fetched status */
bool fetchedFromConsole() const;