Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
electroly committed May 27, 2024
1 parent 7e91334 commit 9b34dd3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 61 deletions.
80 changes: 20 additions & 60 deletions src/compiler/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,32 +90,20 @@ class ProcedureState {
#endif
}

void popValue() {
op(Opcode::kPopValue);
}
void popObject() {
op(Opcode::kPopObject);
}
void duplicateValue() {
op(Opcode::kDuplicateValue);
}
void popValue() { op(Opcode::kPopValue); }
void popObject() { op(Opcode::kPopObject); }
void duplicateValue() { op(Opcode::kDuplicateValue); }
void duplicateValues(uint8_t count) {
op(Opcode::kDuplicateValues);
emitInt<uint8_t>(count);
}
void duplicateObject() {
op(Opcode::kDuplicateObject);
}
void duplicateObject() { op(Opcode::kDuplicateObject); }
void duplicateObjects(uint8_t count) {
op(Opcode::kDuplicateObjects);
emitInt<uint8_t>(count);
}
void swapValues() {
op(Opcode::kSwapValues);
}
void swapObjects() {
op(Opcode::kSwapObjects);
}
void swapValues() { op(Opcode::kSwapValues); }
void swapObjects() { op(Opcode::kSwapObjects); }
void copyValue(uint8_t index) {
op(Opcode::kCopyValue);
emitInt<uint8_t>(index);
Expand Down Expand Up @@ -253,27 +241,13 @@ class ProcedureState {
}
}

void returnVoid() {
op(Opcode::kReturn);
}
void returnValue() {
op(Opcode::kReturnValue);
}
void returnObject() {
op(Opcode::kReturnObject);
}
void setError() {
op(Opcode::kSetError);
}
void clearError() {
op(Opcode::kClearError);
}
void bubbleError() {
op(Opcode::kBubbleError);
}
void returnIfError() {
op(Opcode::kReturnIfError);
}
void returnVoid() { op(Opcode::kReturn); }
void returnValue() { op(Opcode::kReturnValue); }
void returnObject() { op(Opcode::kReturnObject); }
void setError() { op(Opcode::kSetError); }
void clearError() { op(Opcode::kClearError); }
void bubbleError() { op(Opcode::kBubbleError); }
void returnIfError() { op(Opcode::kReturnIfError); }

void branchIfError(int labelId) {
op(Opcode::kBranchIfError);
Expand Down Expand Up @@ -335,29 +309,15 @@ class ProcedureState {
emitInt<uint16_t>(fieldIndex);
}

void dottedExpressionValueKeySuffix(bool isValueElement) {
emitInt<uint8_t>(isValueElement ? 3 : 4);
}
void dottedExpressionValueKeySuffix(bool isValueElement) { emitInt<uint8_t>(isValueElement ? 3 : 4); }

void dottedExpressionObjectKeySuffix(bool isValueElement) {
emitInt<uint8_t>(isValueElement ? 5 : 6);
}
void dottedExpressionObjectKeySuffix(bool isValueElement) { emitInt<uint8_t>(isValueElement ? 5 : 6); }

void objectToObjectMapTryGet() {
op(Opcode::kObjectToObjectMapTryGet);
}
void objectToValueMapTryGet() {
op(Opcode::kObjectToValueMapTryGet);
}
void valueToObjectMapTryGet() {
op(Opcode::kValueToObjectMapTryGet);
}
void valueToValueMapTryGet() {
op(Opcode::kValueToValueMapTryGet);
}
void setErrorMapKeyNotFound() {
op(Opcode::kSetErrorMapKeyNotFound);
}
void objectToObjectMapTryGet() { op(Opcode::kObjectToObjectMapTryGet); }
void objectToValueMapTryGet() { op(Opcode::kObjectToValueMapTryGet); }
void valueToObjectMapTryGet() { op(Opcode::kValueToObjectMapTryGet); }
void valueToValueMapTryGet() { op(Opcode::kValueToValueMapTryGet); }
void setErrorMapKeyNotFound() { op(Opcode::kSetErrorMapKeyNotFound); }

private:
template <typename TOutputInt, typename TInputInt>
Expand Down
4 changes: 3 additions & 1 deletion src/tmbasic/CodeEditorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ static std::vector<compiler::TokenKind> tokenizeLine(std::string_view str) {
void CodeEditorWindow::handleNotification(const SCNotification& scn, turbo::Editor& aEditor) {
BasicEditorWindow::handleNotification(scn, aEditor);
if (scn.nmhdr.code == SCN_STYLENEEDED) {
{ handleStyleToNeeded(scn.position); }
{
handleStyleToNeeded(scn.position);
}
}
}

Expand Down

0 comments on commit 9b34dd3

Please sign in to comment.