minor fixups

This commit is contained in:
Green Sky
2025-09-09 12:45:05 +02:00
parent 6ce40a3c0b
commit c6abeed021
4 changed files with 8 additions and 7 deletions

View File

@@ -5,11 +5,8 @@ project(green_crdt)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(GREEN_CRDT_STANDALONE ON)
# why the f do i need this >:(
set(NOT_GREEN_CRDT_STANDALONE OFF)
else()
set(GREEN_CRDT_STANDALONE OFF)
set(NOT_GREEN_CRDT_STANDALONE ON)
endif()
message("II GREEN_CRDT_STANDALONE " ${GREEN_CRDT_STANDALONE})
@@ -58,6 +55,10 @@ if (GREEN_CRDT_STANDALONE)
endif()
endif()
# TODO: also make option
# note: hardcoded on in tests
add_compile_definitions(EXTRA_ASSERTS=1)
endif()
# cmake setup end

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9...3.24 FATAL_ERROR)
project(crdt_version3 CXX C)

View File

@@ -4,7 +4,6 @@
#include <optional>
#include <unordered_map>
#include <vector>
#include <string>
#include <cassert>

View File

@@ -3,6 +3,7 @@
#include "./list.hpp"
#include <variant>
#include <string>
//#include <iostream> // debug
@@ -51,7 +52,7 @@ struct TextDocument {
}
bool apply(const Op& op) {
if(std::holds_alternative<OpAdd>(op)) {
if (std::holds_alternative<OpAdd>(op)) {
const auto& add_op = std::get<OpAdd>(op);
//std::cout << "a:" << add_op.id.id << " s:" << add_op.id.seq << " v:" << add_op.value << "\n";
return state.add(add_op.id, add_op.value, add_op.parent_left, add_op.parent_right);
@@ -97,7 +98,7 @@ struct TextDocument {
return ops;
}
// adds in tast with specified parents
// adds in text with specified parents
// returns generated ops
std::vector<Op> addText(
std::optional<typename ListType::ListID> parent_left,