1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-13 13:57:19 +00:00

Allow enabling/disabling of peg module.

Use compiler define -DJANET_NO_PEG to turn off the peg module.
This commit is contained in:
Calvin Rose
2019-02-17 21:22:03 -05:00
parent 54227ebff1
commit 1e70c97ef0
4 changed files with 12 additions and 1 deletions

View File

@@ -753,7 +753,9 @@ JanetTable *janet_core_env(void) {
janet_lib_debug(env);
janet_lib_string(env);
janet_lib_marsh(env);
#ifdef JANET_PEG
janet_lib_peg(env);
#endif
#ifdef JANET_ASSEMBLER
janet_lib_asm(env);
#endif

View File

@@ -20,6 +20,8 @@
* IN THE SOFTWARE.
*/
#ifdef JANET_PEG
#ifndef JANET_AMALG
#include <janet/janet.h>
#include <string.h>
@@ -1105,3 +1107,5 @@ static const JanetReg peg_cfuns[] = {
void janet_lib_peg(JanetTable *env) {
janet_core_cfuns(env, NULL, peg_cfuns);
}
#endif /* ifdef JANET_PEG */

View File

@@ -123,6 +123,11 @@ extern "C" {
#define JANET_ASSEMBLER
#endif
/* Enable or disable the peg module */
#ifndef JANET_NO_PEG
#define JANET_PEG
#endif
/* How to export symbols */
#ifndef JANET_API
#ifdef JANET_WINDOWS