|
Serene Runtime 1.0.0
C runtime for the Serene programming language
|
#include <stddef.h>#include <stdint.h>#include "llvm-c/Core.h"#include "llvm-c/Types.h"#include "serene/rt/impl/seq.h"Go to the source code of this file.
Data Structures | |
| struct | srn_src_location_t |
| struct | srn_metadata_t |
| struct | srn_syntax_t |
| struct | srn_value_t |
Macros | |
| #define | SIZE_OF_VALUE_PALYLOAD 8 |
| #define | TYPE(value_ref) |
| #define | METADATA(value_ref) |
| #define | IS_A(value_ref, field) |
| #define | IS_TRUE(value_ref) |
| #define | IS_FALSE(value_ref) |
| #define | IS_NIL(value_ref) |
| #define | AS_I64(value_ref) |
| #define | AS_F64(value_ref) |
| #define | AS_CLOSURE(value_ref) |
| #define | AS_NS(value_ref) |
| #define | AS_STRING(value_ref) |
| #define | AS_SYMBOL(value_ref) |
| #define | AS_ERROR(value_ref) |
| #define | AS_LIST(value_ref) |
| #define | AS_KEYWORD(value_ref) |
| #define | AS_SEQ(value_ref) |
| #define | AS_MAP(value_ref) |
Typedefs | |
| typedef struct srn_expr_t | srn_expr_t |
| typedef struct srn_value_t | srn_value_t |
| typedef struct srn_error_t | srn_error_t |
| typedef struct srn_namespace_t | srn_namespace_t |
| typedef struct srn_string_t | srn_string_t |
| typedef struct srn_symbol_t | srn_symbol_t |
| typedef struct srn_list_t | srn_list_t |
| typedef struct srn_keyword_t | srn_keyword_t |
| typedef struct srn_seq_t | srn_seq_t |
| typedef struct srn_map_t | srn_map_t |
| typedef srn_value_t *(* | srn_fnptr_t) (srn_context_t *ctx, srn_value_t *argv, uint32_t argc) |
| typedef struct srn_src_location_t | srn_src_location_t |
| typedef struct srn_metadata_t | srn_metadata_t |
| typedef enum srn_syntax_tag_e | srn_syntax_tag_t |
| typedef struct srn_syntax_t | srn_syntax_t |
| typedef enum srn_value_tag_e | srn_value_tag_t |
Enumerations | |
| enum | srn_syntax_tag_e : size_t { SNil = 0 , STrue , SFalse , SSymbol , SNumber , SList , SSeq , SQuote , SString , SKeyword , SMap , SError } |
| enum | srn_value_tag_e : size_t { VNil = 0 , VTrue , VFalse , VI64 , VF64 , VList , VSeq , VQuote , VClosure , VNamespace , VString , VSymbol , VKeyword , VMap , VError } |
Functions | |
| srn_value_t * | srn_value_make (srn_context_t *ctx, srn_value_tag_t tag, srn_metadata_t *metadata, void *payload) |
| Creates a new serene value. | |
| static LLVMTypeRef | srn_llvm_value_t (LLVMContextRef llctx) |
| LLVM type for srn_value_t in LLVM IR. { i64, ptr, i64 }. | |
Variables | |
| static srn_metadata_t | absurd_metadata = {nullptr, nullptr} |
| We use this for testing. | |
| static srn_value_t | nil_v = {.type = VNil} |
| static srn_value_t | true_v = {.type = VTrue} |
| static srn_value_t | false_v = {.type = VFalse} |
| #define AS_CLOSURE | ( | value_ref | ) |
| #define AS_KEYWORD | ( | value_ref | ) |
| #define AS_STRING | ( | value_ref | ) |
| #define AS_SYMBOL | ( | value_ref | ) |
| #define IS_A | ( | value_ref, | |
| field ) |
| #define IS_FALSE | ( | value_ref | ) |
| #define IS_NIL | ( | value_ref | ) |
| #define IS_TRUE | ( | value_ref | ) |
| typedef struct srn_expr_t srn_expr_t |
| typedef srn_value_t *(* srn_fnptr_t) (srn_context_t *ctx, srn_value_t *argv, uint32_t argc) |
| typedef struct srn_metadata_t srn_metadata_t |
| typedef struct srn_src_location_t srn_src_location_t |
| typedef struct srn_syntax_t srn_syntax_t |
| typedef enum srn_syntax_tag_e srn_syntax_tag_t |
| typedef enum srn_value_tag_e srn_value_tag_t |
| enum srn_syntax_tag_e : size_t |
| Enumerator | |
|---|---|
| SNil | |
| STrue | |
| SFalse | |
| SSymbol | |
| SNumber | |
| SList | |
| SSeq | |
| SQuote | |
| SString | |
| SKeyword | |
| SMap | |
| SError | SError should be last. |
| enum srn_value_tag_e : size_t |
| Enumerator | |
|---|---|
| VNil | |
| VTrue | |
| VFalse | |
| VI64 | |
| VF64 | |
| VList | |
| VSeq | |
| VQuote | |
| VClosure | |
| VNamespace | |
| VString | |
| VSymbol | |
| VKeyword | |
| VMap | |
| VError | VError should be last. |
|
inlinestatic |
LLVM type for srn_value_t in LLVM IR. { i64, ptr, i64 }.
Definition at line 186 of file core.h.
|
nodiscard |
Creates a new serene value.
We always heap allocate the values. So, ANY value creation should go through this function
Definition at line 24 of file core.c.
|
static |
|
static |
|
static |
|
static |