Skip to content

Commit 01e174b

Browse files
committed
rename project to merve
1 parent a68e945 commit 01e174b

18 files changed

Lines changed: 184 additions & 169 deletions

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ jobs:
4545
- os: ubuntu-22.04
4646
cxx: g++-12
4747
cmake_gen: Ninja
48-
cmake_flags: "-DLEXER_SANITIZE=ON"
48+
cmake_flags: "-DMERVE_SANITIZE=ON"
4949
name_suffix: " (ASAN)"
5050
# Ubuntu with ASAN (Clang)
5151
- os: ubuntu-22.04
5252
cxx: clang++-15
5353
cmake_gen: Ninja
54-
cmake_flags: "-DLEXER_SANITIZE=ON"
54+
cmake_flags: "-DMERVE_SANITIZE=ON"
5555
name_suffix: " (ASAN)"
5656
# macOS 14
5757
- os: macos-14
@@ -67,7 +67,7 @@ jobs:
6767
- os: macos-15
6868
cxx: clang++
6969
cmake_gen: Ninja
70-
cmake_flags: "-DLEXER_SANITIZE=ON"
70+
cmake_flags: "-DMERVE_SANITIZE=ON"
7171
name_suffix: " (ASAN)"
7272
# Windows
7373
- os: windows-latest
@@ -79,13 +79,13 @@ jobs:
7979
- os: ubuntu-latest
8080
cxx: g++-13
8181
cmake_gen: Ninja
82-
cmake_flags: "-DLEXER_USE_SIMDUTF=ON"
82+
cmake_flags: "-DMERVE_USE_SIMDUTF=ON"
8383
name_suffix: " (simdutf)"
8484
# Ubuntu with simdutf + ASAN
8585
- os: ubuntu-latest
8686
cxx: g++-13
8787
cmake_gen: Ninja
88-
cmake_flags: "-DLEXER_USE_SIMDUTF=ON -DLEXER_SANITIZE=ON"
88+
cmake_flags: "-DMERVE_USE_SIMDUTF=ON -DMERVE_SANITIZE=ON"
8989
name_suffix: " (simdutf, ASAN)"
9090

9191
name: ${{ matrix.os }} ${{ matrix.cxx || 'MSVC' }}${{ matrix.name_suffix || '' }}
@@ -103,13 +103,13 @@ jobs:
103103

104104
- name: Configure (Unix)
105105
if: matrix.os != 'windows-latest'
106-
run: cmake -DLEXER_TESTING=ON ${{ matrix.cmake_flags }} -G "${{ matrix.cmake_gen }}" -B build
106+
run: cmake -DMERVE_TESTING=ON ${{ matrix.cmake_flags }} -G "${{ matrix.cmake_gen }}" -B build
107107
env:
108108
CXX: ${{ matrix.cxx }}
109109

110110
- name: Configure (Windows)
111111
if: matrix.os == 'windows-latest'
112-
run: cmake -DLEXER_TESTING=ON ${{ matrix.cmake_flags }} -G "${{ matrix.cmake_gen }}" -A ${{ matrix.cmake_arch }} -B build
112+
run: cmake -DMERVE_TESTING=ON ${{ matrix.cmake_flags }} -G "${{ matrix.cmake_gen }}" -A ${{ matrix.cmake_arch }} -B build
113113

114114
- name: Build (Unix)
115115
if: matrix.os != 'windows-latest'

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ jobs:
5454

5555
- name: Build singleheader
5656
run: |
57-
cmake -DLEXER_TESTING=OFF -G Ninja -B build
58-
cmake --build build --target lexer-singleheader-lib
57+
cmake -DMERVE_TESTING=OFF -G Ninja -B build
58+
cmake --build build --target merve-singleheader-lib
5959
6060
- name: Create singleheader.zip
6161
run: |
6262
cd build/singleheader
63-
zip singleheader.zip lexer.h lexer.cpp
63+
zip singleheader.zip merve.h merve.cpp
6464
mv singleheader.zip ../../singleheader/
65-
cp lexer.h lexer.cpp ../../singleheader/
65+
cp merve.h merve.cpp ../../singleheader/
6666
6767
- name: Create release
6868
run: ./tools/release/create_release.py

CMakeLists.txt

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
cmake_minimum_required(VERSION 3.16)
22

3-
project(lexer
3+
project(merve
44
DESCRIPTION "Fast lexer to extract named exports via analysis from CommonJS modules"
55
LANGUAGES C CXX
66
VERSION 1.0.0
77
)
88

9-
set(LEXER_LIB_VERSION "1.0.0" CACHE STRING "lexer library version")
10-
set(LEXER_LIB_SOVERSION "1" CACHE STRING "lexer library soversion")
9+
set(MERVE_LIB_VERSION "1.0.0" CACHE STRING "lexer library version")
10+
set(MERVE_LIB_SOVERSION "1" CACHE STRING "lexer library soversion")
1111

1212
include(GNUInstallDirs)
1313

1414
# Optional simdutf support for optimized string operations
15-
if(LEXER_USE_SIMDUTF)
15+
if(MERVE_USE_SIMDUTF)
1616
# Try to find simdutf system package first
1717
find_package(simdutf QUIET)
1818
if(NOT simdutf_FOUND)
@@ -32,35 +32,35 @@ if(LEXER_USE_SIMDUTF)
3232
message(STATUS "simdutf enabled for optimized string operations")
3333
else()
3434
message(WARNING "simdutf requested but not found, building without it")
35-
set(LEXER_USE_SIMDUTF OFF)
35+
set(MERVE_USE_SIMDUTF OFF)
3636
endif()
3737
endif()
3838

3939
include(CTest)
4040
include(cmake/lexer-flags.cmake)
4141

42-
set(LEXER_SOURCE_DIR src)
42+
set(MERVE_SOURCE_DIR src)
4343

4444
add_subdirectory(src)
4545

4646
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake)
4747

48-
option(LEXER_BENCHMARKS "Build benchmarks" OFF)
49-
option(LEXER_TESTING "Build tests" ${BUILD_TESTING})
48+
option(MERVE_BENCHMARKS "Build benchmarks" OFF)
49+
option(MERVE_TESTING "Build tests" ${BUILD_TESTING})
5050

5151
# There are cases where when embedding lexer as a dependency for other CMake
5252
# projects as submodules or subdirectories (via FetchContent) can lead to
5353
# errors due to CPM, so this is here to support disabling all the testing
5454
# for lexer if one only wishes to use the lexer library.
55-
if(LEXER_TESTING OR LEXER_BENCHMARKS)
55+
if(MERVE_TESTING OR MERVE_BENCHMARKS)
5656
# Try to find GTest system package first
5757
find_package(GTest QUIET)
5858
if(NOT GTest_FOUND)
5959
include(cmake/CPM.cmake)
6060
# CPM requires git as an implicit dependency
6161
find_package(Git QUIET)
6262
# We use googletest in the tests
63-
if(Git_FOUND AND LEXER_TESTING)
63+
if(Git_FOUND AND MERVE_TESTING)
6464
CPMAddPackage(
6565
NAME GTest
6666
GITHUB_REPOSITORY google/googletest
@@ -70,7 +70,7 @@ if(LEXER_TESTING OR LEXER_BENCHMARKS)
7070
endif()
7171
endif()
7272
# We use Google Benchmark, but it does not build under several 32-bit systems.
73-
if(Git_FOUND AND LEXER_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
73+
if(Git_FOUND AND MERVE_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
7474
CPMAddPackage(
7575
NAME benchmark
7676
GITHUB_REPOSITORY google/benchmark
@@ -82,7 +82,7 @@ if(LEXER_TESTING OR LEXER_BENCHMARKS)
8282
)
8383
endif()
8484

85-
if (LEXER_TESTING AND NOT EMSCRIPTEN)
85+
if (MERVE_TESTING AND NOT EMSCRIPTEN)
8686
if(Git_FOUND)
8787
message(STATUS "The tests are enabled.")
8888
add_subdirectory(tests)
@@ -93,102 +93,102 @@ if(LEXER_TESTING OR LEXER_BENCHMARKS)
9393
if(is_top_project)
9494
message(STATUS "The tests are disabled.")
9595
endif()
96-
endif(LEXER_TESTING AND NOT EMSCRIPTEN)
96+
endif(MERVE_TESTING AND NOT EMSCRIPTEN)
9797

98-
If(LEXER_BENCHMARKS AND NOT EMSCRIPTEN)
98+
If(MERVE_BENCHMARKS AND NOT EMSCRIPTEN)
9999
if(Git_FOUND)
100100
message(STATUS "Lexer benchmarks enabled.")
101101
add_subdirectory(benchmarks)
102102
else()
103103
message(STATUS "The benchmarks are disabled because git was not found.")
104104
endif()
105-
else(LEXER_BENCHMARKS AND NOT EMSCRIPTEN)
105+
else(MERVE_BENCHMARKS AND NOT EMSCRIPTEN)
106106
if(is_top_project)
107-
message(STATUS "Lexer benchmarks disabled. Set LEXER_BENCHMARKS=ON to enable them.")
107+
message(STATUS "Lexer benchmarks disabled. Set MERVE_BENCHMARKS=ON to enable them.")
108108
endif()
109-
endif(LEXER_BENCHMARKS AND NOT EMSCRIPTEN)
109+
endif(MERVE_BENCHMARKS AND NOT EMSCRIPTEN)
110110

111-
if (LEXER_TESTING AND EMSCRIPTEN)
111+
if (MERVE_TESTING AND EMSCRIPTEN)
112112
add_subdirectory(tests/wasm)
113-
endif(LEXER_TESTING AND EMSCRIPTEN)
113+
endif(MERVE_TESTING AND EMSCRIPTEN)
114114
endif()
115115

116116

117-
add_library(lexer::lexer ALIAS lexer)
117+
add_library(merve::merve ALIAS merve)
118118

119119
set_target_properties(
120-
lexer PROPERTIES
121-
VERSION "${LEXER_LIB_VERSION}"
122-
SOVERSION "${LEXER_LIB_SOVERSION}"
120+
merve PROPERTIES
121+
VERSION "${MERVE_LIB_VERSION}"
122+
SOVERSION "${MERVE_LIB_SOVERSION}"
123123
WINDOWS_EXPORT_ALL_SYMBOLS YES
124124
)
125125

126126
include(CMakePackageConfigHelpers)
127127
include(GNUInstallDirs)
128128

129-
if(NOT LEXER_COVERAGE AND NOT EMSCRIPTEN)
129+
if(NOT MERVE_COVERAGE AND NOT EMSCRIPTEN)
130130
add_subdirectory(singleheader)
131131
endif()
132132

133133
install(
134134
FILES include/lexer.h
135135
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
136-
COMPONENT lexer_development
136+
COMPONENT merve_development
137137
)
138138

139139
install(
140140
DIRECTORY include/lexer
141141
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
142-
COMPONENT lexer_development
142+
COMPONENT merve_development
143143
)
144144

145145
install(
146-
TARGETS lexer
147-
EXPORT lexer_targets
148-
RUNTIME COMPONENT lexer_runtime
149-
LIBRARY COMPONENT lexer_runtime
150-
NAMELINK_COMPONENT lexer_development
151-
ARCHIVE COMPONENT lexer_development
146+
TARGETS merve
147+
EXPORT merve_targets
148+
RUNTIME COMPONENT merve_runtime
149+
LIBRARY COMPONENT merve_runtime
150+
NAMELINK_COMPONENT merve_development
151+
ARCHIVE COMPONENT merve_development
152152
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
153153
)
154154

155-
configure_file(cmake/lexer-config.cmake.in lexer-config.cmake @ONLY)
155+
configure_file(cmake/merve-config.cmake.in merve-config.cmake @ONLY)
156156

157157
write_basic_package_version_file(
158-
lexer-config-version.cmake
158+
merve-config-version.cmake
159159
COMPATIBILITY SameMinorVersion
160160
)
161161

162162
set(
163-
LEXER_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/lexer"
163+
MERVE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/merve"
164164
CACHE STRING "CMake package config location relative to the install prefix"
165165
)
166-
mark_as_advanced(LEXER_INSTALL_CMAKEDIR)
166+
mark_as_advanced(MERVE_INSTALL_CMAKEDIR)
167167

168168
install(
169169
FILES
170-
"${PROJECT_BINARY_DIR}/lexer-config.cmake"
171-
"${PROJECT_BINARY_DIR}/lexer-config-version.cmake"
172-
DESTINATION "${LEXER_INSTALL_CMAKEDIR}"
173-
COMPONENT lexer_development
170+
"${PROJECT_BINARY_DIR}/merve-config.cmake"
171+
"${PROJECT_BINARY_DIR}/merve-config-version.cmake"
172+
DESTINATION "${MERVE_INSTALL_CMAKEDIR}"
173+
COMPONENT merve_development
174174
)
175175

176176
install(
177-
EXPORT lexer_targets
178-
NAMESPACE lexer::
179-
DESTINATION "${LEXER_INSTALL_CMAKEDIR}"
180-
COMPONENT lexer_development
177+
EXPORT merve_targets
178+
NAMESPACE merve::
179+
DESTINATION "${MERVE_INSTALL_CMAKEDIR}"
180+
COMPONENT merve_development
181181
)
182182

183183
install(
184-
EXPORT lexer_targets
185-
NAMESPACE lexer::
186-
DESTINATION "${LEXER_INSTALL_CMAKEDIR}"
184+
EXPORT merve_targets
185+
NAMESPACE merve::
186+
DESTINATION "${MERVE_INSTALL_CMAKEDIR}"
187187
COMPONENT example_development
188188
)
189189

190190
if(is_top_project)
191-
set(CPACK_PACKAGE_VENDOR "Lexer Authors")
191+
set(CPACK_PACKAGE_VENDOR "Merve Authors")
192192
set(CPACK_PACKAGE_CONTACT "yagiz@nizipli.com")
193193
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE-MIT")
194194
set(CPACK_RPM_PACKAGE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE-MIT")

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# commonjs-lexer
1+
# merve
22

33
A fast C++ lexer for extracting named exports from CommonJS modules. This library performs static analysis to detect CommonJS export patterns without executing the code.
44

@@ -18,18 +18,18 @@ A fast C++ lexer for extracting named exports from CommonJS modules. This librar
1818
```cmake
1919
include(FetchContent)
2020
FetchContent_Declare(
21-
commonjs-lexer
22-
GIT_REPOSITORY https://github.com/user/commonjs-lexer.git
21+
merve
22+
GIT_REPOSITORY https://github.com/anonrig/merve.git
2323
GIT_TAG main
2424
)
25-
FetchContent_MakeAvailable(commonjs-lexer)
25+
FetchContent_MakeAvailable(merve)
2626
2727
target_link_libraries(your_target PRIVATE lexer::lexer)
2828
```
2929

3030
### Single Header
3131

32-
Copy `singleheader/lexer.h` and `singleheader/lexer.cpp` to your project.
32+
Copy `singleheader/merve.h` and `singleheader/merve.cpp` to your project.
3333

3434
## Usage
3535

@@ -237,23 +237,23 @@ cmake --build . --target real_world_tests
237237

238238
| Option | Default | Description |
239239
|--------|---------|-------------|
240-
| `LEXER_TESTING` | `ON` | Build test suite |
241-
| `LEXER_BENCHMARKS` | `OFF` | Build benchmarks |
242-
| `LEXER_USE_SIMDUTF` | `OFF` | Use simdutf for optimized string operations |
243-
| `LEXER_SANITIZE` | `OFF` | Enable address sanitizer |
240+
| `MERVE_TESTING` | `ON` | Build test suite |
241+
| `MERVE_BENCHMARKS` | `OFF` | Build benchmarks |
242+
| `MERVE_USE_SIMDUTF` | `OFF` | Use simdutf for optimized string operations |
243+
| `MERVE_SANITIZE` | `OFF` | Enable address sanitizer |
244244

245245
### Building with simdutf
246246

247247
To enable SIMD-accelerated string operations:
248248

249249
```bash
250-
cmake -B build -DLEXER_USE_SIMDUTF=ON
250+
cmake -B build -DMERVE_USE_SIMDUTF=ON
251251
cmake --build build
252252
```
253253

254-
When `LEXER_USE_SIMDUTF=ON`, CMake will automatically fetch simdutf via CPM if it's not found on the system. The library uses simdutf's optimized `find()` function for faster escape sequence detection.
254+
When `MERVE_USE_SIMDUTF=ON`, CMake will automatically fetch simdutf via CPM if it's not found on the system. The library uses simdutf's optimized `find()` function for faster escape sequence detection.
255255

256-
For projects that already have simdutf available (like Node.js), define `LEXER_USE_SIMDUTF=1` and ensure the simdutf header is in the include path.
256+
For projects that already have simdutf available (like Node.js), define `MERVE_USE_SIMDUTF=1` and ensure the simdutf header is in the include path.
257257

258258
## Performance
259259

cmake/add-cpp-test.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ function(add_cpp_test TEST_NAME)
1010
if (ARGS_COMPILE_ONLY)
1111
list(APPEND ${ARGS_LABELS} compile_only)
1212
endif()
13-
if(LEXER_SANITIZE)
13+
if(MERVE_SANITIZE)
1414
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
1515
add_compile_definitions(ASAN_OPTIONS=detect_leaks=1)
1616
endif()
17-
if(LEXER_SANITIZE_BOUNDS_STRICT)
17+
if(MERVE_SANITIZE_BOUNDS_STRICT)
1818
add_compile_options(-fsanitize=bounds-strict -fno-sanitize-recover=all)
1919
add_link_options(-fsanitize=bounds-strict)
2020
endif()
21-
if(LEXER_SANITIZE_UNDEFINED)
21+
if(MERVE_SANITIZE_UNDEFINED)
2222
add_compile_options(-fsanitize=undefined -fno-sanitize-recover=all)
2323
add_link_options(-fsanitize=undefined)
2424
endif()

cmake/lexer-config.cmake.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)