Browse Source

added type support

main
Ludovic 'Archivist' Lagouardette 7 months ago
parent
commit
7012cd3b91
7 changed files with 45 additions and 1 deletions
  1. +8
    -0
      .idea/.gitignore
  2. +2
    -0
      .idea/ink.iml
  3. +4
    -0
      .idea/misc.xml
  4. +8
    -0
      .idea/modules.xml
  5. +6
    -0
      .idea/vcs.xml
  6. +16
    -0
      ink.h
  7. +1
    -1
      lib.c

+ 8
- 0
.idea/.gitignore View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

+ 2
- 0
.idea/ink.iml View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

+ 4
- 0
.idea/misc.xml View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

+ 8
- 0
.idea/modules.xml View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ink.iml" filepath="$PROJECT_DIR$/.idea/ink.iml" />
</modules>
</component>
</project>

+ 6
- 0
.idea/vcs.xml View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

+ 16
- 0
ink.h View File

@ -85,6 +85,18 @@ struct ink_routine {
void *routine_userdata;
};
struct ink_collection_list {
struct elem* elems;
size_t size;
};
struct ink_type {
const char* name;
void* elements;
void (*collect)(void*);
struct ink_collection_list (*gc)(void*);
};
/**
* Represents a complete execution context for the ink interpreter
*/
@ -99,6 +111,10 @@ struct context {
struct ink_routine *routines;
int routines_capacity;
int routines_top;
struct ink_type *types;
int types_capacity;
int types_top;
/**
* Contains the id of the routine that is currently being manipulated

+ 1
- 1
lib.c View File

@ -4,7 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifdef INSTRUMENTION
#ifdef INSTRUMENTATION
#include <time.h>
#endif
#endif

Loading…
Cancel
Save