diff --git a/.gitignore b/.gitignore index 19c3f99..008c293 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ a.out main lisp wisp -boot.lisp \ No newline at end of file +boot.lisp +cmake-build-debug/ +cmake-build-release/ + diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..88a62e7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/wisp.iml b/.idea/wisp.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/wisp.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..22823bd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.20) +project(wisp) + +set(CMAKE_CXX_STANDARD 14) + +add_executable(wisp wisp.cpp) diff --git a/wisp.cpp b/wisp.cpp index 4d35304..20d7406 100644 --- a/wisp.cpp +++ b/wisp.cpp @@ -917,9 +917,9 @@ Value parse(std::string &s, int &ptr) { while (s[ptr] == ';') { // If this is a comment - int save_ptr = ptr; - while (s[save_ptr] != '\n' && save_ptr < int(s.length())) { save_ptr++; } - s.erase(ptr, save_ptr - ptr); + int work_ptr = ptr; + while (s[work_ptr] != '\n' && work_ptr < int(s.length())) { work_ptr++; } + ptr = work_ptr; skip_whitespace(s, ptr); if (s.substr(ptr, s.length()-ptr-1) == "")