From 75b0a45730c047dc8bf77060f4fade2488e073fa Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 19 Oct 2009 01:53:13 +0000 Subject: [PATCH] Added cyrver to make clean, fixed GC protection for CYJS*, implemented array comprehensions and for each, added a -c flag for pure-compiler mode, and added (driver.pool_) tags on some memory allocations in the grammar. --- Console.cpp | 22 ++++++-- Cycript.l | 4 +- Cycript.y | 49 ++++++++++------- Library.mm | 12 +++++ Output.cpp | 124 +++++++++++++++++++++++++++++++++++------- Parser.hpp | 151 ++++++++++++++++++++++++++++++++++++++++++++++------ makefile | 2 +- 7 files changed, 304 insertions(+), 60 deletions(-) diff --git a/Console.cpp b/Console.cpp index fdfc054..b3702ca 100644 --- a/Console.cpp +++ b/Console.cpp @@ -218,6 +218,7 @@ static void Console(int socket) { else { CYDriver driver(""); cy::parser parser(driver); + //parser.set_debug_level(1); driver.data_ = command.c_str(); driver.size_ = command.size(); @@ -301,14 +302,19 @@ static void *Map(const char *path, size_t *psize) { int main(int argc, char *argv[]) { bool tty(isatty(STDIN_FILENO)); pid_t pid(_not(pid_t)); + bool compile(false); - for (;;) switch (getopt(argc, argv, "p:")) { + for (;;) switch (getopt(argc, argv, "cp:")) { case -1: goto getopt; case '?': - fprintf(stderr, "usage: cycript [-p ] [