diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6142305..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.o -*.d diff --git a/lab1/Justfile b/lab1/Justfile deleted file mode 100644 index 1ab8b38..0000000 --- a/lab1/Justfile +++ /dev/null @@ -1,18 +0,0 @@ -all: a1 a2 a3 a4 - -a1: - g++ -o hello hello.cc - ./hello -a2: - g++ -std=c++11 -o separate_main separate_main.cc separate_fn.cc - -a3: - g++ -std=c++11 -c separate_main.cc - g++ -std=c++11 -c separate_fn.cc - g++ -std=c++11 -o separate_main separate_main.o separate_fn.o - -a4: - g++ -std=c++11 -o separate_main separate_main.cc - -a5: - g++ -c -O2 -Wall -Wextra -pedantic-errors -Wold-style-cast -std=c++11 hello.cc diff --git a/lab1/editor.cc b/lab1/editor.cc index fca27d4..82ec95b 100644 --- a/lab1/editor.cc +++ b/lab1/editor.cc @@ -6,29 +6,11 @@ using std::string; using size_type = Editor::size_type; -size_type Editor::get_size() const { return text.size(); } - -Editor::size_type Editor::find_left_par(size_type pos) const { - char right_par = text[pos]; - char left_par; - - // Determine the matching left parenthesis for the given right parenthesis - switch (right_par) { - case ')': left_par = '('; break; - case ']': left_par = '['; break; - case '}': left_par = '{'; break; - default: return string::npos; // Not a valid right parenthesis - } - - int balance = 1; // Start with the right parenthesis at text[pos] - for (size_type i = pos; i-- > 0;) { - if (text[i] == left_par) { - balance--; - if (balance == 0) return i; // Found the matching left parenthesis - } else if (text[i] == right_par) { - balance++; - } - } - - return string::npos; // No matching left parenthesis found +size_type Editor::get_size() const +{ + return text.size(); +} + +size_type Editor::find_left_par(size_type pos) const { + return string::npos; } diff --git a/lab1/hello.cc b/lab1/hello.cc deleted file mode 100644 index b873300..0000000 --- a/lab1/hello.cc +++ /dev/null @@ -1,5 +0,0 @@ -#include - -int main(int argc, char *argv[]) { - std::cout << "Hello" << std::endl; -}