Skip to content

Commit

Permalink
Merge pull request #462 from yamacir-kit/character
Browse files Browse the repository at this point in the history
Character
  • Loading branch information
yamacir-kit authored Sep 17, 2023
2 parents f86e1e2 + eaafa85 commit b11675b
Show file tree
Hide file tree
Showing 12 changed files with 35,158 additions and 68 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
include/meevax/unicode
src/kernel/basis.cpp
src/kernel/version.cpp
23 changes: 15 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,29 @@ else()
set(${PROJECT_NAME}_BYTE_ORDER "little-endian")
endif()

execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --digit-value OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DIGIT_VALUE)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --downcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DOWNCASE)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --property OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_PROPERTY)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --upcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_UPCASE)

file(GLOB ${PROJECT_NAME}_BASIS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/basis/*.ss)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/configure/help.txt ${PROJECT_NAME}_HELP_UNCONFIGURED)
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/digit_value.hpp "${${PROJECT_NAME}_UNICODE_DIGIT_VALUE}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/downcase.hpp "${${PROJECT_NAME}_UNICODE_DOWNCASE}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/property.hpp "${${PROJECT_NAME}_UNICODE_PROPERTY}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/upcase.hpp "${${PROJECT_NAME}_UNICODE_UPCASE}")

string(CONFIGURE ${${PROJECT_NAME}_HELP_UNCONFIGURED} ${PROJECT_NAME}_HELP)

string(TOLOWER ${CMAKE_SYSTEM_NAME} ${PROJECT_NAME}_SYSTEM_NAME)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/README.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md)

file(GLOB ${PROJECT_NAME}_BASIS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/basis/*.ss)

foreach(EACH IN LISTS ${PROJECT_NAME}_BASIS_SOURCES)
get_filename_component(FILENAME ${EACH} NAME)
file(READ ${EACH} ${PROJECT_NAME}_BASIS_${FILENAME})
endforeach()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/basis.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/README.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/basis.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp)

# ---- Target kernel -----------------------------------------------------------

Expand All @@ -73,7 +79,8 @@ add_library(${PROJECT_NAME}::kernel ALIAS kernel)

file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp)

target_sources(kernel PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES})
target_sources(kernel PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES}
PRIVATE ${${PROJECT_NAME}_OBJECTS})

target_include_directories(kernel PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Subset of R7RS-small.
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make package
sudo apt install build/meevax_0.4.795_amd64.deb
sudo apt install build/meevax_0.4.804_amd64.deb
```

or
Expand Down Expand Up @@ -106,15 +106,15 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|-------------|-------------
| `all` | Build shared-library `libmeevax.0.4.795.so` and executable `meevax`
| `all` | Build shared-library `libmeevax.0.4.804.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.4.795_amd64.deb`
| `package` | Generate debian package `meevax_0.4.804_amd64.deb`
| `install` | Copy files into `/usr/local` directly

## Usage

```
Meevax Lisp 0.4.795
Meevax Lisp 0.4.804
Usage:
meevax [option...] [file...]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.795
0.4.804
34 changes: 0 additions & 34 deletions basis/r4rs-essential.ss
Original file line number Diff line number Diff line change
Expand Up @@ -389,40 +389,6 @@
(define (char-ci>=? x . xs)
(char-ci-compare x xs >=))

(define (char-alphabetic? x)
(<= (char->integer #\a)
(char->integer (char-downcase x))
(char->integer #\z)))

(define (char-numeric? x)
(<= (char->integer #\0)
(char->integer x)
(char->integer #\9)))

(define (char-whitespace? x)
(or (eqv? x #\space)
(eqv? x #\tab)
(eqv? x #\newline)
(eqv? x #\return)))

(define (char-upper-case? x)
(<= (char->integer #\A)
(char->integer x)
(char->integer #\Z)))

(define (char-lower-case? x)
(<= (char->integer #\a)
(char->integer x)
(char->integer #\z)))

(define (char-downcase c)
(if (char-lower-case? c) c
(integer->char (+ (char->integer c) 32))))

(define (char-upcase c)
(if (char-upper-case? c) c
(integer->char (- (char->integer c) 32))))

(define (string . xs)
(list->string xs))

Expand Down
Loading

0 comments on commit b11675b

Please sign in to comment.