mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Moved time header includes, comment tweaks
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include "lib_standard.h"
|
||||
|
||||
#include "toy_common.h"
|
||||
#include "memory.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
static int nativeClock(Interpreter* interpreter, LiteralArray* arguments) {
|
||||
//no arguments
|
||||
if (arguments->count != 0) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "lib_timer.h"
|
||||
|
||||
#include "toy_common.h"
|
||||
#include "memory.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
//GOD DAMN IT: https://stackoverflow.com/questions/15846762/timeval-subtract-explanation
|
||||
int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y) {
|
||||
|
||||
@@ -100,7 +100,7 @@ int main(int argc, const char* argv[]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//TODO: remove this when the interpreter meets the specification
|
||||
//version
|
||||
if (command.verbose) {
|
||||
printf(NOTICE "Toy Programming Language Version %d.%d.%d\n" RESET, TOY_VERSION_MAJOR, TOY_VERSION_MINOR, TOY_VERSION_PATCH);
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ union _node {
|
||||
NodeFnDecl fnDecl;
|
||||
NodeFnCall fnCall;
|
||||
NodeFnReturn returns;
|
||||
NodeIf pathIf; //TODO: rename these to ifStmt?
|
||||
NodeIf pathIf;
|
||||
NodeWhile pathWhile;
|
||||
NodeFor pathFor;
|
||||
NodeBreak pathBreak;
|
||||
|
||||
@@ -380,7 +380,7 @@ int hashLiteral(Literal lit) {
|
||||
|
||||
case LITERAL_FUNCTION:
|
||||
case LITERAL_FUNCTION_NATIVE:
|
||||
return 0; //TODO: find a way to hash these properly
|
||||
return 0; //can't hash these
|
||||
|
||||
case LITERAL_IDENTIFIER:
|
||||
return HASH_I(lit); //pre-computed
|
||||
@@ -564,7 +564,6 @@ void printLiteralCustom(Literal literal, void (printFn)(const char*)) {
|
||||
}
|
||||
break;
|
||||
|
||||
//TODO: functions
|
||||
case LITERAL_FUNCTION:
|
||||
case LITERAL_FUNCTION_NATIVE:
|
||||
printFn("(function)");
|
||||
|
||||
@@ -77,8 +77,6 @@ bool setLiteralArray(LiteralArray* array, Literal index, Literal value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO: implicit push when referencing one-past-the-end?
|
||||
|
||||
freeLiteral(array->literals[idx]);
|
||||
array->literals[idx] = copyLiteral(value);
|
||||
|
||||
|
||||
@@ -9,22 +9,15 @@
|
||||
#define TOY_VERSION_PATCH 5
|
||||
#define TOY_VERSION_BUILD __DATE__ " " __TIME__
|
||||
|
||||
//NOTE: I don't know why the time headers are here, need to try moving them back to the correct spots again
|
||||
//platform exports/imports
|
||||
//platform-specific specifications
|
||||
#if defined(__linux__)
|
||||
#define TOY_API extern
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#elif defined(_WIN32) || defined(WIN32)
|
||||
#define TOY_API
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#else
|
||||
#define TOY_API
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user