The REPL can now be disabled at build time using -DFUN_WITH_REPL=OFF. (0.17.7)
This commit is contained in:
parent
f68d09c596
commit
5c2273da69
4 changed files with 1149 additions and 1220 deletions
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(fun VERSION 0.17.6 LANGUAGES C)
|
||||
project(fun VERSION 0.17.7 LANGUAGES C)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
|
@ -94,7 +94,9 @@ add_executable(fun
|
|||
# Provide version string to the CLI
|
||||
target_compile_definitions(fun PRIVATE FUN_VERSION=\"${PROJECT_VERSION}\")
|
||||
if(FUN_WITH_REPL)
|
||||
target_compile_definitions(fun PRIVATE FUN_WITH_REPL=0)
|
||||
# Enable REPL compilation path and add the REPL source
|
||||
target_compile_definitions(fun PRIVATE FUN_WITH_REPL=1)
|
||||
target_sources(fun PRIVATE src/repl.c)
|
||||
endif()
|
||||
target_link_libraries(fun PRIVATE fun_core)
|
||||
|
||||
|
|
|
|||
1115
src/repl.c
Normal file
1115
src/repl.c
Normal file
File diff suppressed because it is too large
Load diff
20
src/repl.h
Normal file
20
src/repl.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef FUN_REPL_H
|
||||
#define FUN_REPL_H
|
||||
|
||||
#include "vm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef FUN_WITH_REPL
|
||||
// Runs the interactive REPL using the provided, already-initialized VM.
|
||||
// Returns 0 on normal exit.
|
||||
int fun_run_repl(VM *vm);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // FUN_REPL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue