diff options
| author | 2021-05-28 15:12:05 -0500 | |
|---|---|---|
| committer | 2021-05-28 15:12:05 -0500 | |
| commit | 7ff204ec44d267bb6279cc13ca26b0639586ed14 (patch) | |
| tree | 7d3e7b237cc3200a036aef12cf163394e16150d3 /src/include/janet.h | |
| parent | Make jpm configurable for environments like MinGW. (diff) | |
Work on system for adding compiler warnings.
This is the beginning of a system for compiler warnings. This includes
linting, deprecation notices, and other compiler warnings that are best
detected by the `compile` function and don't require the partial
evalutaion of the flychecker.
Diffstat (limited to 'src/include/janet.h')
| -rw-r--r-- | src/include/janet.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/include/janet.h b/src/include/janet.h index 0b41987c..1319a28d 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -299,9 +299,10 @@ typedef struct { /***** START SECTION TYPES *****/ #ifdef JANET_WINDOWS -// Must be defined before including stdlib.h +/* Must be defined before including stdlib.h */ #define _CRT_RAND_S #endif + #include <stdlib.h> #include <stdint.h> #include <string.h> @@ -1409,6 +1410,11 @@ struct JanetCompileResult { enum JanetCompileStatus status; }; JANET_API JanetCompileResult janet_compile(Janet source, JanetTable *env, JanetString where); +JANET_API JanetCompileResult janet_compile_lint( + Janet source, + JanetTable *env, + JanetString where, + JanetArray *lints); /* Get the default environment for janet */ JANET_API JanetTable *janet_core_env(JanetTable *replacements); @@ -1664,11 +1670,24 @@ typedef enum { JANET_BINDING_VAR, JANET_BINDING_MACRO } JanetBindingType; + +typedef struct { + JanetBindingType type; + Janet value; + enum { + JANET_BINDING_DEP_NONE, + JANET_BINDING_DEP_RELAXED, + JANET_BINDING_DEP_NORMAL, + JANET_BINDING_DEP_STRICT, + } deprecation; +} JanetBinding; + JANET_API void janet_def(JanetTable *env, const char *name, Janet val, const char *documentation); JANET_API void janet_var(JanetTable *env, const char *name, Janet val, const char *documentation); JANET_API void janet_cfuns(JanetTable *env, const char *regprefix, const JanetReg *cfuns); JANET_API void janet_cfuns_prefix(JanetTable *env, const char *regprefix, const JanetReg *cfuns); JANET_API JanetBindingType janet_resolve(JanetTable *env, JanetSymbol sym, Janet *out); +JANET_API JanetBinding janet_resolve_ext(JanetTable *env, JanetSymbol sym); JANET_API void janet_register(const char *name, JanetCFunction cfun); /* Get values from the core environment. */ |
