cpp
authorMichael Wallner <mike@php.net>
Mon, 28 Nov 2016 09:00:15 +0000 (10:00 +0100)
committerMichael Wallner <mike@php.net>
Wed, 3 May 2017 06:44:00 +0000 (08:44 +0200)
37 files changed:
Makefile.frag
src/context.c
src/cpp.c [new file with mode: 0644]
src/cpp.h [new file with mode: 0644]
src/cpp_tokiter.c [new file with mode: 0644]
src/marshal.c
src/module.c
src/parser.c
src/parser.h
src/parser.re
src/parser_def.h
src/parser_proc.c
src/parser_proc.h
src/parser_proc.y
src/parser_proc_def.h [new file with mode: 0644]
src/plist.c
src/plist.h
src/token.c
src/token.h
src/types.h
src/types/assert_stmt.c
src/types/cpp_exp.c [new file with mode: 0644]
src/types/cpp_exp.h [new file with mode: 0644]
src/types/cpp_macro_call.c [new file with mode: 0644]
src/types/cpp_macro_call.h [new file with mode: 0644]
src/types/cpp_macro_decl.c [new file with mode: 0644]
src/types/cpp_macro_decl.h [new file with mode: 0644]
src/types/decl_enum_item.c
src/types/impl_def_val.c
src/types/let_exp.c
src/types/num_exp.c
src/types/num_exp.h
src/types/number.c
src/types/number.h
src/types/set_exp.c
tests/idn/idn.psi
tests/parser/cpp/define001.psi [new file with mode: 0644]

index 502b1e2..39ba8c0 100644 (file)
@@ -23,7 +23,8 @@ $(PHP_PSI_BUILDDIR)/lemon: $(PHP_PSI_BUILDDIR)/lemon.c | $(PHP_PSI_BUILDDIR)/lem
 $(PHP_PSI_SRCDIR)/src/parser_proc.h: $(PHP_PSI_SRCDIR)/src/parser_proc.c
 
 $(PHP_PSI_SRCDIR)/src/parser_proc.inc:
-$(PHP_PSI_SRCDIR)/src/parser_proc.y: $(PHP_PSI_SRCDIR)/src/parser_def.h $(PHP_PSI_SRCDIR)/src/parser_proc.inc
+$(PHP_PSI_SRCDIR)/src/parser_proc_def.h: $(PHP_PSI_SRCDIR)/src/parser_def.h
+$(PHP_PSI_SRCDIR)/src/parser_proc.y: $(PHP_PSI_SRCDIR)/src/parser_proc_def.h $(PHP_PSI_SRCDIR)/src/parser_proc.inc
        cat $(PHP_PSI_SRCDIR)/src/parser_proc.inc >$@
        $(CPP) -P -DGENERATE $< >>$@
 $(PHP_PSI_SRCDIR)/src/parser_proc.c: $(PHP_PSI_SRCDIR)/src/parser_proc.y $(LEMON)
index d4510eb..199f533 100644 (file)
@@ -256,14 +256,7 @@ void psi_context_build(struct psi_context *C, const char *paths)
                                        continue;
                                }
 
-                               while (0 < psi_parser_scan(&P)) {
-                                       psi_parser_parse(&P, psi_token_alloc(&P));
-                                       if (P.num == PSI_T_EOF) {
-                                               break;
-                                       }
-                               }
-
-                               psi_parser_parse(&P, NULL);
+                               psi_parser_parse(&P);
                                psi_context_add_data(C, PSI_DATA(&P));
                                psi_parser_dtor(&P);
                        }
@@ -341,7 +334,7 @@ zend_function_entry *psi_context_compile(struct psi_context *C)
                                zend_string *name = strpprintf(0, "psi\\%s\\%s", e->name, item->name);
 
                                zc.name = zend_string_dup(name, 1);
-                               ZVAL_LONG(&zc.value, psi_long_num_exp(item->num, NULL));
+                               ZVAL_LONG(&zc.value, psi_long_num_exp(item->num, NULL, NULL));
                                zend_register_constant(&zc);
                                zend_string_release(name);
                        }
diff --git a/src/cpp.c b/src/cpp.c
new file mode 100644 (file)
index 0000000..8fcd5cf
--- /dev/null
+++ b/src/cpp.c
@@ -0,0 +1,453 @@
+/*******************************************************************************
+ Copyright (c) 2017, Michael Wallner <mike@php.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+     * Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#include "php_psi_stdinc.h"
+
+#include "cpp.h"
+#include "parser.h"
+
+static inline bool psi_cpp_level_skipped(struct psi_cpp_data *cpp)
+{
+       return cpp->skip == cpp->level;
+}
+static inline void psi_cpp_level_skip(struct psi_cpp_data *cpp)
+{
+       assert(!cpp->skip);
+       cpp->skip = cpp->level;
+}
+static inline void psi_cpp_level_unskip(struct psi_cpp_data *cpp)
+{
+       if (psi_cpp_level_skipped(cpp)) {
+               cpp->skip = 0;
+       }
+}
+static inline bool psi_cpp_level_masked(struct psi_cpp_data *cpp)
+{
+       return cpp->seen & (1 << cpp->level);
+}
+static inline void psi_cpp_level_mask(struct psi_cpp_data *cpp)
+{
+       assert(!psi_cpp_level_masked(cpp));
+       cpp->seen |= (1 << cpp->level);
+}
+static inline void psi_cpp_level_unmask(struct psi_cpp_data *cpp)
+{
+       cpp->seen &= ~(1 << cpp->level);
+}
+
+static void psi_cpp_eval(struct psi_data *D, struct psi_cpp_data *cpp)
+{
+       assert(cpp->exp);
+
+       PSI_DEBUG_PRINT(D, "PSI: CPP EVAL < %s (level=%u, skip=%u)\n",
+                       cpp->exp->token->text, cpp->level, cpp->skip);
+
+#if PSI_CPP_DEBUG
+       psi_cpp_exp_dump(2, cpp->exp);
+#endif
+
+       switch (cpp->exp->type) {
+       case PSI_T_ERROR:
+               if (!cpp->skip) {
+                       D->error(D, cpp->exp->token, PSI_ERROR, "%s",
+                                       cpp->exp->data.tok->text);
+               }
+               break;
+       case PSI_T_WARNING:
+               if (!cpp->skip) {
+                       D->error(D, cpp->exp->token, PSI_WARNING, "%s",
+                                       cpp->exp->data.tok->text);
+               }
+               break;
+       case PSI_T_UNDEF:
+               if (!cpp->skip) {
+                       psi_cpp_undef(cpp, cpp->exp->data.tok);
+               }
+               break;
+       case PSI_T_DEFINE:
+               if (!cpp->skip) {
+                       psi_cpp_define(cpp, cpp->exp->data.decl);
+                       /* FIXME: copy */
+                       cpp->exp->data.decl = NULL;
+               }
+               break;
+       case PSI_T_IFDEF:
+               ++cpp->level;
+               if (!cpp->skip) {
+                       if (psi_cpp_defined(cpp, cpp->exp->data.tok)) {
+                               psi_cpp_level_mask(cpp);
+                       } else {
+                               psi_cpp_level_skip(cpp);
+                       }
+               }
+               break;
+       case PSI_T_IFNDEF:
+               ++cpp->level;
+               if (!cpp->skip) {
+                       if (psi_cpp_defined(cpp, cpp->exp->data.tok)) {
+                               psi_cpp_level_skip(cpp);
+                       } else {
+                               psi_cpp_level_mask(cpp);
+                       }
+               }
+               break;
+       case PSI_T_IF:
+               ++cpp->level;
+               if (!cpp->skip) {
+                       if (psi_cpp_if(cpp->exp, &cpp->defs, D)) {
+                               psi_cpp_level_mask(cpp);
+                       } else {
+                               psi_cpp_level_skip(cpp);
+                       }
+               }
+               break;
+       case PSI_T_ENDIF:
+               if (!cpp->level) {
+                       D->error(D, cpp->exp->token, PSI_WARNING, "Ingoring lone #endif");
+               } else {
+                       psi_cpp_level_unskip(cpp);
+                       psi_cpp_level_unmask(cpp);
+                       --cpp->level;
+               }
+               break;
+       case PSI_T_ELSE:
+               /* FIXME: catch "else" after "else" */
+               if (!cpp->level) {
+                       D->error(D, cpp->exp->token, PSI_WARNING, "Ingoring lone #else");
+               } else if (psi_cpp_level_skipped(cpp) && !psi_cpp_level_masked(cpp)) {
+                       /*
+                        * if skip is set on this level and the level has
+                        * not been masked yet, then unskip and mask this level
+                        */
+                       psi_cpp_level_unskip(cpp);
+                       psi_cpp_level_mask(cpp);
+               } else if (!cpp->skip && psi_cpp_level_masked(cpp)) {
+                       /*
+                        * previous block masked this level
+                        */
+                       psi_cpp_level_skip(cpp);
+               } else {
+                       assert(cpp->skip < cpp->level);
+               }
+               break;
+       case PSI_T_ELIF:
+               if (!cpp->level) {
+                       D->error(D, cpp->exp->token, PSI_WARNING, "Ingoring lone #elif");
+               } else if (psi_cpp_level_skipped(cpp) && !psi_cpp_level_masked(cpp)) {
+                       /*
+                        * if skip is set on this level and the level has
+                        * not been masked yet, then unskip and mask this
+                        * level, if the condition evals truthy
+                        */
+                       if (psi_cpp_if(cpp->exp, &cpp->defs, D)) {
+                               psi_cpp_level_unskip(cpp);
+                               psi_cpp_level_mask(cpp);
+                       }
+               } else if (!cpp->skip && psi_cpp_level_masked(cpp)) {
+                       /*
+                        * previous block masked this level
+                        */
+                       psi_cpp_level_skip(cpp);
+               } else {
+                       assert(cpp->skip < cpp->level);
+               }
+               break;
+       default:
+               assert(0);
+               break;
+       }
+
+       PSI_DEBUG_PRINT(D, "PSI: CPP EVAL > %s (level=%u, skip=%u)\n",
+                       cpp->exp->token->text, cpp->level, cpp->skip);
+
+       psi_cpp_exp_free(&cpp->exp);
+}
+
+static bool psi_cpp_stage1(struct psi_parser *P, struct psi_cpp_data *cpp)
+{
+       bool name = false, define = false, hash = false, eol = true, esc = false, ws = false;
+
+       psi_cpp_tokiter_reset(cpp);
+       while (psi_cpp_tokiter_valid(cpp)) {
+               struct psi_token *token = psi_cpp_tokiter_current(cpp);
+
+               /* strip comments */
+               if (token->type == PSI_T_COMMENT) {
+                       psi_cpp_tokiter_del_cur(cpp, true);
+                       continue;
+               }
+
+               /* line continuations */
+               if (token->type == PSI_T_EOL) {
+                       if (esc) {
+                               psi_cpp_tokiter_del_range(cpp, psi_cpp_tokiter_index(cpp) - 1, 2, true);
+                               psi_cpp_tokiter_prev(cpp);
+                               esc = false;
+                               continue;
+                       }
+               } else if (token->type == PSI_T_BSLASH) {
+                       esc = !esc;
+               } else {
+                       esc = false;
+               }
+
+               /* this whole turf is needed to distinct between:
+                * #define foo (1,2,3)
+                * #define foo(a,b,c)
+                */
+
+               if (token->type == PSI_T_WHITESPACE) {
+                       ws = true;
+                       psi_cpp_tokiter_del_cur(cpp, true);
+                       continue;
+               }
+
+               switch (token->type) {
+               case PSI_T_EOL:
+                       eol = true;
+                       break;
+               case PSI_T_HASH:
+                       if (eol) {
+                               hash = true;
+                               eol = false;
+                       }
+                       break;
+               case PSI_T_DEFINE:
+                       if (hash) {
+                               define = true;
+                               hash = false;
+                       }
+                       break;
+               case PSI_T_NAME:
+                       if (define) {
+                               name = true;
+                               define = false;
+                       }
+                       break;
+               case PSI_T_LPAREN:
+                       if (name) {
+                               name = false;
+                               if (!ws) {
+                                       /* mask special token for parser */
+                                       struct psi_token *no_ws = psi_token_copy(token);
+
+                                       no_ws->type = PSI_T_NO_WHITESPACE;
+                                       no_ws->text[0] = '\xA0';
+                                       psi_cpp_tokiter_ins_cur(cpp, no_ws);
+                                       continue;
+                               }
+                       }
+                       /* no break */
+               default:
+                       name = define = hash = eol = false;
+                       break;
+               }
+
+               ws = false;
+               psi_cpp_tokiter_next(cpp);
+       }
+
+       return true;
+}
+
+static bool psi_cpp_stage2(struct psi_parser *P, struct psi_cpp_data *cpp)
+{
+       do {
+               bool is_eol = true, do_cpp = false, do_expansion = true, skip_paren = false, skip_all = false;
+
+               psi_cpp_tokiter_reset(cpp);
+
+               while (psi_cpp_tokiter_valid(cpp)) {
+                       struct psi_token *current = psi_cpp_tokiter_current(cpp);
+
+                       if (current->type == PSI_T_HASH) {
+                               if (is_eol) {
+                                       do_cpp = true;
+                                       is_eol = false;
+                               }
+                       } else if (current->type == PSI_T_EOL) {
+#if PSI_CPP_DEBUG
+                               fprintf(stderr, "PSI: CPP do_expansion=true, PSI_T_EOL\n");
+#endif
+                               is_eol = true;
+                               skip_all = false;
+                               do_expansion = true;
+                               if (!do_cpp) {
+                                       psi_cpp_tokiter_del_cur(cpp, true);
+                                       continue;
+                               }
+                       } else {
+                               is_eol = false;
+
+                               if (do_cpp) {
+                                       switch (current->type) {
+                                       case PSI_T_DEFINE:
+#if PSI_CPP_DEBUG
+                                               fprintf(stderr, "PSI: CPP do_expansion=false, PSI_T_DEFINE, skip_all\n");
+#endif
+                                               do_expansion = false;
+                                               skip_all = true;
+                                               break;
+                                       case PSI_T_DEFINED:
+                                               skip_paren = true;
+                                               /* no break */
+                                       case PSI_T_IFDEF:
+                                       case PSI_T_IFNDEF:
+                                       case PSI_T_UNDEF:
+#if PSI_CPP_DEBUG
+                                               fprintf(stderr, "PSI: CPP do_expansion=false, PSI_T_{IF{,N},UN}DEF\n");
+#endif
+                                               do_expansion = false;
+                                               break;
+                                       case PSI_T_LPAREN:
+                                               if (!skip_all) {
+                                                       if (skip_paren) {
+                                                               skip_paren = false;
+                                                       } else {
+                                                               do_expansion = true;
+#if PSI_CPP_DEBUG
+                                                               fprintf(stderr, "PSI: CPP do_expansion=true, PSI_T_LPAREN, !skip_all, !skip_paren\n");
+#endif
+                                                       }
+                                               }
+                                               break;
+                                       case PSI_T_NAME:
+                                               break;
+                                       default:
+                                               do_expansion = !skip_all;
+#if PSI_CPP_DEBUG
+                                               fprintf(stderr, "PSI CPP do_expansion=%s, <- !skip_all\n", do_expansion?"true":"false");
+#endif
+                                       }
+                               }
+                       }
+
+                       if (cpp->skip) {
+                               /* FIXME: del_range */
+                               if (!do_cpp) {
+#if PSI_CPP_DEBUG
+                                       fprintf(stderr, "PSI: CPP skip ");
+                                       psi_token_dump(2, current);
+#endif
+                                       psi_cpp_tokiter_del_cur(cpp, true);
+                                       continue;
+                               }
+                       }
+
+                       if (do_expansion && current->type == PSI_T_NAME && psi_cpp_tokiter_defined(cpp)) {
+                               bool expanded = false;
+
+                               while (psi_cpp_tokiter_expand(cpp)) {
+                                       expanded = true;
+                               }
+                               if (expanded) {
+                                       continue;
+                               }
+                       }
+
+                       if (do_cpp) {
+                               if (is_eol) {
+                                       do_cpp = false;
+                                       skip_all = false;
+                               }
+
+                               if (P->flags & PSI_DEBUG) {
+                                       fprintf(stderr, "PSI> Parse (%zu) ", psi_cpp_tokiter_index(cpp));
+                                       psi_token_dump(2, current);
+                               }
+
+                               psi_parser_proc_parse(P->proc, current->type, current, P);
+                               psi_cpp_tokiter_del_cur(cpp, false);
+
+                               if (is_eol) {
+                                       psi_parser_proc_parse(P->proc, 0, NULL, P);
+                                       psi_cpp_eval(PSI_DATA(P), cpp);
+                               }
+
+#if PSI_CPP_DEBUG
+                               psi_cpp_tokiter_dump(2, cpp);
+#endif
+
+                               continue;
+                       }
+
+                       psi_cpp_tokiter_next(cpp);
+               }
+       } while (cpp->expanded);
+
+       return true;
+}
+
+bool psi_cpp_preprocess(struct psi_parser *P, struct psi_cpp_data *cpp)
+{
+       if (!psi_cpp_stage1(P, cpp)) {
+               return false;
+       }
+
+       if (!psi_cpp_stage2(P, cpp)) {
+               return false;
+       }
+
+       return true;
+}
+
+bool psi_cpp_defined(struct psi_cpp_data *cpp, struct psi_token *tok)
+{
+       bool defined;
+
+       if (tok->type == PSI_T_NAME) {
+               defined = zend_hash_str_exists(&cpp->defs, tok->text, tok->size);
+       } else {
+               defined = false;
+       }
+
+#if PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP defined -> %s ", defined ? "true" : "false");
+       psi_token_dump(2, tok);
+#endif
+
+       return defined;
+}
+
+void psi_cpp_define(struct psi_cpp_data *cpp, struct psi_cpp_macro_decl *decl)
+{
+       zend_hash_str_add_ptr(&cpp->defs, decl->token->text, decl->token->size, decl);
+}
+
+bool psi_cpp_undef(struct psi_cpp_data *cpp, struct psi_token *tok)
+{
+       return SUCCESS == zend_hash_str_del(&cpp->defs, tok->text, tok->size);
+}
+
+bool psi_cpp_if(struct psi_cpp_exp *exp, HashTable *defs, struct psi_data *D)
+{
+       if (!psi_num_exp_validate(D, exp->data.num, NULL, NULL, NULL, NULL, NULL)) {
+               return false;
+       }
+       if (!psi_long_num_exp(exp->data.num, NULL, defs)) {
+               return false;
+       }
+       return true;
+}
diff --git a/src/cpp.h b/src/cpp.h
new file mode 100644 (file)
index 0000000..1a8fc2c
--- /dev/null
+++ b/src/cpp.h
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ Copyright (c) 2017, Michael Wallner <mike@php.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+     * Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef PSI_CPP_H
+#define PSI_CPP_H
+
+#include "data.h"
+
+#ifndef PSI_CPP_DEBUG
+# define PSI_CPP_DEBUG 0
+#endif
+
+struct psi_cpp_data {
+       HashTable defs;
+       unsigned level;
+       unsigned skip;
+       unsigned seen;
+       size_t index;
+       struct psi_plist *tokens;
+       unsigned expanded;
+       struct psi_cpp_exp *exp;
+};
+
+bool psi_cpp_preprocess(struct psi_parser *P, struct psi_cpp_data *cpp);
+bool psi_cpp_if(struct psi_cpp_exp *exp, HashTable *defs, struct psi_data *D);
+bool psi_cpp_defined(struct psi_cpp_data *cpp, struct psi_token *tok);
+void psi_cpp_define(struct psi_cpp_data *cpp, struct psi_cpp_macro_decl *decl);
+bool psi_cpp_undef(struct psi_cpp_data *cpp, struct psi_token *tok);
+
+void psi_cpp_tokiter_reset(struct psi_cpp_data *cpp);
+bool psi_cpp_tokiter_seek(struct psi_cpp_data *cpp, size_t index);
+void psi_cpp_tokiter_dump(int fd, struct psi_cpp_data *cpp);
+struct psi_token *psi_cpp_tokiter_current(struct psi_cpp_data *cpp);
+size_t psi_cpp_tokiter_index(struct psi_cpp_data *cpp);
+void psi_cpp_tokiter_next(struct psi_cpp_data *cpp);
+void psi_cpp_tokiter_prev(struct psi_cpp_data *cpp);
+bool psi_cpp_tokiter_valid(struct psi_cpp_data *cpp);
+bool psi_cpp_tokiter_del_cur(struct psi_cpp_data *cpp, bool free_token);
+bool psi_cpp_tokiter_del_range(struct psi_cpp_data *cpp, size_t offset,
+               size_t num_eles, bool free_tokens);
+bool psi_cpp_tokiter_ins_cur(struct psi_cpp_data *cpp, struct psi_token *tok);
+bool psi_cpp_tokiter_ins_range(struct psi_cpp_data *cpp, size_t offset,
+               size_t num_eles, void **eles);
+bool psi_cpp_tokiter_defined(struct psi_cpp_data *cpp);
+bool psi_cpp_tokiter_expand(struct psi_cpp_data *cpp);
+
+#endif
diff --git a/src/cpp_tokiter.c b/src/cpp_tokiter.c
new file mode 100644 (file)
index 0000000..e1d45f3
--- /dev/null
@@ -0,0 +1,419 @@
+/*******************************************************************************
+ Copyright (c) 2017, Michael Wallner <mike@php.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+     * Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#include "php_psi_stdinc.h"
+
+#include "cpp.h"
+#include "parser.h"
+
+
+void psi_cpp_tokiter_dump(int fd, struct psi_cpp_data *cpp)
+{
+       size_t i;
+       struct psi_token *T;
+
+       for (i = 0; psi_plist_get(cpp->tokens, i, &T); ++i) {
+               dprintf(fd, "PSI: CPP tokens %5zu %c ", i, cpp->index == i ? '*' : ' ');
+               psi_token_dump(fd, T);
+       }
+}
+
+void psi_cpp_tokiter_reset(struct psi_cpp_data *cpp)
+{
+#if PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP reset (%zu tokens)\n", psi_plist_count(cpp->tokens));
+       psi_cpp_tokiter_dump(2, cpp);
+#endif
+       cpp->index = 0;
+       cpp->expanded = 0;
+}
+
+bool psi_cpp_tokiter_seek(struct psi_cpp_data *cpp, size_t index)
+{
+       if (index < psi_plist_count(cpp->tokens)) {
+               cpp->index = index;
+               return true;
+       }
+       return false;
+}
+
+struct psi_token *psi_cpp_tokiter_current(struct psi_cpp_data *cpp)
+{
+       struct psi_token *current = NULL;
+       bool found = psi_plist_get(cpp->tokens, cpp->index, &current);
+
+       assert(found);
+
+       return current;
+}
+
+size_t psi_cpp_tokiter_index(struct psi_cpp_data *cpp)
+{
+       return cpp->index;
+}
+
+void psi_cpp_tokiter_next(struct psi_cpp_data *cpp)
+{
+#if 0 && PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP next -> index=%zu -> index=%zu\n", cpp->index, cpp->index+1);
+#endif
+       ++cpp->index;
+}
+
+void psi_cpp_tokiter_prev(struct psi_cpp_data *cpp)
+{
+#if 0 && PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP prev -> index=%zu -> index=%zu\n", cpp->index, cpp->index-1);
+#endif
+       if (cpp->index) {
+               --cpp->index;
+       }
+}
+
+bool psi_cpp_tokiter_valid(struct psi_cpp_data *cpp)
+{
+#if 0 && PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP valid -> index=%zu -> %d\n", cpp->index, cpp->index < psi_plist_count(cpp->tokens));
+#endif
+       return cpp->index < psi_plist_count(cpp->tokens);
+}
+
+bool psi_cpp_tokiter_del_cur(struct psi_cpp_data *cpp, bool free_token)
+{
+       struct psi_token *cur = NULL;
+       bool deleted = psi_plist_del(cpp->tokens, cpp->index, &cur);
+
+#if PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP del_cur -> index=%zu, del=%d, free=%d ",
+                       cpp->index, (int) deleted, (int) free_token);
+       if (cur) {
+               psi_token_dump(2, cur);
+       } else {
+               fprintf(stderr, "NULL\n");
+       }
+#endif
+       if (cur && free_token) {
+               free(cur);
+       }
+       if (deleted && cpp->index >= psi_plist_count(cpp->tokens)) {
+               cpp->index = MAX(0, psi_plist_count(cpp->tokens)-1);
+       }
+       return deleted;
+}
+
+bool psi_cpp_tokiter_del_range(struct psi_cpp_data *cpp, size_t offset, size_t num_eles, bool free_tokens)
+{
+       struct psi_token **ptr;
+       bool deleted;
+
+       if (free_tokens) {
+               ptr = calloc(num_eles, sizeof(*ptr));
+       } else {
+               ptr = NULL;
+       }
+
+#if PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP del_range -> index=%zu, offset=%zu, num_eles=%zu\n", cpp->index, offset, num_eles);
+#endif
+
+       deleted = psi_plist_del_range(cpp->tokens, offset, num_eles, (void *) ptr);
+
+       if (deleted) {
+               if (cpp->index >= psi_plist_count(cpp->tokens)) {
+                       cpp->index = MAX(0, psi_plist_count(cpp->tokens)-1);
+               }
+               if (free_tokens) {
+                       while (num_eles--) {
+                               if (ptr[num_eles]) {
+                                       free(ptr[num_eles]);
+                               }
+                       }
+                       free(ptr);
+               }
+       }
+       return deleted;
+}
+
+bool psi_cpp_tokiter_ins_cur(struct psi_cpp_data *cpp, struct psi_token *tok)
+{
+       struct psi_plist *tokens = psi_plist_ins(cpp->tokens, cpp->index, &tok);
+
+#if PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP ins_cur -> index=%zu ", cpp->index);
+       psi_token_dump(2, tok);
+#endif
+
+       if (!tokens) {
+               return false;
+       }
+       cpp->tokens = tokens;
+       return true;
+}
+
+bool psi_cpp_tokiter_ins_range(struct psi_cpp_data *cpp, size_t offset,
+               size_t num_eles, void **eles)
+{
+       struct psi_plist *tokens = psi_plist_ins_range(cpp->tokens, offset,
+                       num_eles, eles);
+
+#if PSI_CPP_DEBUG
+       fprintf(stderr, "PSI: CPP ins_range -> index=%zu, offset=%zu, num_eles=%zu\n", cpp->index, offset, num_eles);
+#endif
+
+       if (!tokens) {
+               return false;
+       }
+       cpp->tokens = tokens;
+       return true;
+}
+
+bool psi_cpp_tokiter_defined(struct psi_cpp_data *cpp)
+{
+       if (psi_cpp_tokiter_valid(cpp)) {
+               struct psi_token *current = psi_cpp_tokiter_current(cpp);
+
+               return psi_cpp_defined(cpp, current);
+       }
+
+       return false;
+}
+
+void psi_cpp_tokiter_expand_tokens(struct psi_cpp_data *cpp, struct psi_plist *tokens)
+{
+       if (tokens && psi_plist_count(tokens)) {
+               size_t i;
+               struct psi_token **exp_tokens = calloc(psi_plist_count(tokens), sizeof(*exp_tokens));
+
+               for (i = 0; psi_plist_get(tokens, i, &exp_tokens[i]); ++i) {
+                       exp_tokens[i] = psi_token_copy(exp_tokens[i]);
+
+#if PSI_CPP_DEBUG
+                       fprintf(stderr, "PSI: CPP expand > ");
+                       psi_token_dump(2, exp_tokens[i]);
+#endif
+               }
+               psi_cpp_tokiter_ins_range(cpp, psi_cpp_tokiter_index(cpp), i, (void *) exp_tokens);
+               free(exp_tokens);
+       }
+}
+
+static void psi_cpp_tokiter_free_call_tokens(struct psi_plist **arg_tokens_list, size_t arg_count, bool free_tokens)
+{
+       size_t i;
+
+       for (i = 0; i < arg_count; ++i) {
+               if (arg_tokens_list[i]) {
+                       if (free_tokens) {
+                               struct psi_token *tok;
+
+                               while (psi_plist_pop(arg_tokens_list[i], &tok)) {
+                                       free(tok);
+                               }
+                       }
+                       psi_plist_free(arg_tokens_list[i]);
+               }
+       }
+       free(arg_tokens_list);
+}
+
+static struct psi_plist **psi_cpp_tokiter_read_call_tokens(
+               struct psi_cpp_data *cpp, size_t arg_count)
+{
+       size_t arg_index = 0, lparens = 1, rparens = 0;
+       struct psi_plist **arg_tokens = calloc(arg_count, sizeof(*arg_tokens));
+       struct psi_plist *free_tokens = psi_plist_init((void (*)(void *)) psi_token_free);
+       struct psi_token *tok;
+
+       arg_tokens[0] = psi_plist_init(NULL);
+
+       /* free macro name token on success */
+       tok = psi_cpp_tokiter_current(cpp);
+       free_tokens = psi_plist_add(free_tokens, &tok);
+
+       /* next token must be a LPAREN for a macro call */
+       psi_cpp_tokiter_next(cpp);
+       tok = psi_cpp_tokiter_current(cpp);
+       if (!psi_cpp_tokiter_valid(cpp) || tok->type != PSI_T_LPAREN) {
+               goto fail;
+       }
+
+       /* free LPAREN on success */
+       free_tokens = psi_plist_add(free_tokens, &tok);
+
+       while (lparens > rparens) {
+               psi_cpp_tokiter_next(cpp);
+               if (!psi_cpp_tokiter_valid(cpp)) {
+                       goto fail;
+               }
+               tok = psi_cpp_tokiter_current(cpp);
+
+               switch (tok->type) {
+               case PSI_T_LPAREN:
+                       ++lparens;
+                       arg_tokens[arg_index] = psi_plist_add(arg_tokens[arg_index], &tok);
+                       break;
+               case PSI_T_RPAREN:
+                       if (++rparens == lparens) {
+                               /* closing RPAREN */
+                               if (arg_index + 1 < arg_count) {
+                                       goto fail;
+                               }
+                               free_tokens = psi_plist_add(free_tokens, &tok);
+                       } else {
+                               arg_tokens[arg_index] = psi_plist_add(arg_tokens[arg_index], &tok);
+                       }
+                       break;
+               case PSI_T_COMMA:
+                       if (1 == (lparens - rparens)) {
+                               /* too many commas? */
+                               if (++arg_index >= arg_count) {
+                                       goto fail;
+                               }
+                               free_tokens = psi_plist_add(free_tokens, &tok);
+                               /* next arg */
+                               arg_tokens[arg_index] = psi_plist_init(NULL);
+                       } else {
+                               arg_tokens[arg_index] = psi_plist_add(arg_tokens[arg_index], &tok);
+                       }
+                       break;
+               default:
+                       arg_tokens[arg_index] = psi_plist_add(arg_tokens[arg_index], &tok);
+               }
+       }
+
+       psi_plist_free(free_tokens);
+       return arg_tokens;
+
+fail:
+       psi_cpp_tokiter_free_call_tokens(arg_tokens, arg_count, false);
+       return NULL;
+}
+
+static void psi_cpp_tokiter_expand_call_tokens(struct psi_cpp_data *cpp,
+               struct psi_cpp_macro_decl *macro, struct psi_plist **arg_tokens_list)
+{
+       size_t i;
+       struct psi_token *tok;
+
+       for (i = 0; psi_plist_get(macro->tokens, i, &tok); ++i) {
+               struct psi_plist *arg_tokens = NULL;
+
+               if (tok->type == PSI_T_NAME) {
+                       size_t s;
+                       struct psi_token *arg_name;
+
+                       for (s = 0; psi_plist_get(macro->sig, s, &arg_name); ++s) {
+                               if (arg_name->size == tok->size) {
+                                       if (!memcmp(arg_name->text, tok->text, tok->size)) {
+                                               arg_tokens = arg_tokens_list[s];
+                                               break;
+                                       }
+                               }
+                       }
+               }
+
+               if (arg_tokens) {
+                       size_t tok_count = psi_plist_count(arg_tokens);
+
+                       if (tok_count) {
+                               psi_cpp_tokiter_expand_tokens(cpp, arg_tokens);
+                               psi_cpp_tokiter_seek(cpp, psi_cpp_tokiter_index(cpp) + tok_count);
+                       }
+               } else {
+                       psi_cpp_tokiter_ins_cur(cpp, psi_token_copy(tok));
+                       psi_cpp_tokiter_next(cpp);
+               }
+       }
+}
+
+static bool psi_cpp_tokiter_expand_call(struct psi_cpp_data *cpp,
+               struct psi_cpp_macro_decl *macro)
+{
+       /* function-like macro
+        * #define FOO(a,b) a>b // macro->sig == {a, b}, macro->tokens = {a, >, b}
+        * # if FOO(1,2) // expands to if 1 > 2
+        */
+       size_t start = psi_cpp_tokiter_index(cpp);
+       struct psi_plist **arg_tokens_list;
+
+       /* read in tokens, until we have balanced parens */
+       arg_tokens_list = psi_cpp_tokiter_read_call_tokens(cpp, psi_plist_count(macro->sig));
+       if (!arg_tokens_list) {
+               psi_cpp_tokiter_seek(cpp, start);
+               return false;
+       }
+
+       /* ditch arg tokens */
+       psi_cpp_tokiter_del_range(cpp, start, psi_cpp_tokiter_index(cpp) - start + 1, false);
+       psi_cpp_tokiter_seek(cpp, start);
+
+       /* insert and expand macro tokens */
+       psi_cpp_tokiter_expand_call_tokens(cpp, macro, arg_tokens_list);
+       psi_cpp_tokiter_free_call_tokens(arg_tokens_list, psi_plist_count(macro->sig), true);
+
+       /* back to where we took off */
+       psi_cpp_tokiter_seek(cpp, start);
+       ++cpp->expanded;
+       return true;
+}
+
+bool psi_cpp_tokiter_expand(struct psi_cpp_data *cpp)
+{
+       if (psi_cpp_tokiter_valid(cpp)) {
+               struct psi_token *current = psi_cpp_tokiter_current(cpp);
+
+               if (current) {
+                       struct psi_cpp_macro_decl *macro = zend_hash_str_find_ptr(
+                                       &cpp->defs, current->text, current->size);
+
+                       /* don't expand itself */
+                       if (macro && macro->token != current) {
+#if PSI_CPP_DEBUG
+                               fprintf(stderr, "PSI: CPP expand < ");
+                               psi_token_dump(2, current);
+#endif
+                               if (macro->sig) {
+                                       return psi_cpp_tokiter_expand_call(cpp, macro);
+                               } else {
+                                       size_t index = psi_cpp_tokiter_index(cpp);
+
+                                       /* delete current token from stream */
+                                       psi_cpp_tokiter_del_cur(cpp, true);
+
+                                       if (index != psi_cpp_tokiter_index(cpp)) {
+                                               /* might have been last token */
+                                               psi_cpp_tokiter_next(cpp);
+                                       }
+                                       /* replace with tokens from macro */
+                                       psi_cpp_tokiter_expand_tokens(cpp, macro->tokens);
+
+                                       ++cpp->expanded;
+                                       return true;
+                               }
+                       }
+               }
+       }
+       return false;
+}
index 63a7dc9..b36eb5f 100644 (file)
@@ -398,7 +398,7 @@ void psi_set_to_stringl(zval *return_value, struct psi_set_exp *set, impl_val *r
                struct psi_set_exp *sub_exp;
 
                psi_plist_get(set->inner, 0, &sub_exp);
-               RETVAL_STRINGL(str, psi_long_num_exp(sub_exp->data.num, frame));
+               RETVAL_STRINGL(str, psi_long_num_exp(sub_exp->data.num, frame, NULL));
        } else {
                RETVAL_EMPTY_STRING();
        }
@@ -528,7 +528,7 @@ void psi_set_to_array_counted(zval *return_value, struct psi_set_exp *set, impl_
        }
 
        psi_plist_get(set->inner, 0, &sub_exp);
-       count = psi_long_num_exp(sub_exp->data.num, frame);
+       count = psi_long_num_exp(sub_exp->data.num, frame, NULL);
        psi_plist_get(set->inner, 1, &sub_exp);
 
        for (ptr = (char *) ret_val; 0 < count--; ptr += size) {
index b253e0a..1db2adf 100644 (file)
@@ -143,14 +143,7 @@ static PHP_FUNCTION(psi_validate)
                RETURN_FALSE;
        }
 
-       while (0 < psi_parser_scan(&P)) {
-               psi_parser_parse(&P, psi_token_alloc(&P));
-               if (P.num == PSI_T_EOF) {
-                       break;
-               }
-       }
-       psi_parser_parse(&P, NULL);
-
+       psi_parser_parse(&P);
        psi_data_ctor(&D, P.error, P.flags);
        RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors);
        psi_data_dtor(&D);
@@ -180,14 +173,7 @@ static PHP_FUNCTION(psi_validate_string)
                RETURN_FALSE;
        }
 
-       while (0 < psi_parser_scan(&P)) {
-               psi_parser_parse(&P, psi_token_alloc(&P));
-               if (P.num == PSI_T_EOF) {
-                       break;
-               }
-       }
-       psi_parser_parse(&P, NULL);
-
+       psi_parser_parse(&P);
        psi_data_ctor(&D, P.error, P.flags);
        RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors);
        psi_data_dtor(&D);
index 9cafa4e..2b6c11e 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.16 on Tue Feb 21 15:25:35 2017 */
+/* Generated by re2c 0.16 on Tue Mar  7 09:49:40 2017 */
 #line 1 "src/parser.re"
 /*******************************************************************************
  Copyright (c) 2016, Michael Wallner <mike@php.net>.
 #include "php_psi_stdinc.h"
 #include <sys/mman.h>
 #include <assert.h>
+#include <stdarg.h>
 
 #include "parser.h"
 
-void *psi_parser_proc_init(void);
-void psi_parser_proc_free(void **parser_proc);
-void psi_parser_proc_parse(void *parser_proc, token_t r, struct psi_token *token, struct psi_parser *parser);
-void psi_parser_proc_trace(FILE *out, char *prefix);
+#define YYMAXFILL 12
+#ifndef YYMAXFILL
+# define YYMAXFILL 256
+#endif
+#line 57 "src/parser.re"
+
+
+static void free_cpp_def(zval *p)
+{
+       if (Z_TYPE_P(p) == IS_PTR) {
+               psi_cpp_macro_decl_free((void *) &Z_PTR_P(p));
+       } else if (Z_REFCOUNTED_P(p)) {
+               zval_ptr_dtor(p);
+       }
+}
 
 struct psi_parser *psi_parser_init(struct psi_parser *P, psi_error_cb error, unsigned flags)
 {
@@ -49,6 +61,11 @@ struct psi_parser *psi_parser_init(struct psi_parser *P, psi_error_cb error, uns
        P->line = 1;
        P->proc = psi_parser_proc_init();
 
+       zend_hash_init(&P->cpp.defs, 0, NULL, free_cpp_def, 1);
+       zval tmp;
+       ZVAL_ARR(&tmp, &P->cpp.defs);
+       add_assoc_string(&tmp, "PHP_OS", PHP_OS);
+
        if (flags & PSI_DEBUG) {
                psi_parser_proc_trace(stderr, "PSI> ");
        }
@@ -56,162 +73,183 @@ struct psi_parser *psi_parser_init(struct psi_parser *P, psi_error_cb error, uns
        return P;
 }
 
+void psi_parser_reset(struct psi_parser *P)
+{
+       P->cur = P->tok = P->mrk = P->input.buffer;
+       P->lim = P->input.buffer + P->input.length;
+}
+
 bool psi_parser_open_file(struct psi_parser *P, const char *filename)
 {
-       FILE *fp = fopen(filename, "r");
+       struct stat sb;
+       FILE *fp;
+       char *fb;
 
-       if (!fp) {
+       if (stat(filename, &sb)) {
                P->error(PSI_DATA(P), NULL, PSI_WARNING,
-                               "Could not open '%s' for reading: %s",
+                               "Could not stat '%s': %s",
                                filename, strerror(errno));
                return false;
        }
 
-       P->input.type = PSI_PARSE_FILE;
-       P->input.data.file.handle = fp;
-
-#if HAVE_MMAP
-       struct stat sb;
-       int fd = fileno(fp);
+       if (!(fb = malloc(sb.st_size + YYMAXFILL))) {
+               P->error(PSI_DATA(P), NULL, PSI_WARNING,
+                               "Could not allocate %zu bytes for reading '%s': %s",
+                               sb.st_size + YYMAXFILL, filename, strerror(errno));
+               return false;
+       }
 
-       if (fstat(fd, &sb)) {
+       if (!(fp = fopen(filename, "r"))) {
+               free(fb);
                P->error(PSI_DATA(P), NULL, PSI_WARNING,
-                               "Could not stat '%s': %s",
+                               "Could not open '%s' for reading: %s",
                                filename, strerror(errno));
                return false;
        }
 
-       P->input.data.file.buffer = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
-       if (MAP_FAILED == P->input.data.file.buffer) {
+       if (sb.st_size != fread(fb, 1, sb.st_size, fp)) {
+               free(fb);
+               fclose(fp);
                P->error(PSI_DATA(P), NULL, PSI_WARNING,
-                               "Could not map '%s' for reading: %s",
-                               filename, strerror(errno));
+                               "Could not read %zu bytes from '%s': %s",
+                               sb.st_size + YYMAXFILL, filename, strerror(errno));
                return false;
        }
-       P->input.data.file.length = sb.st_size;
-#else
-       P->input.data.file.buffer = malloc(BSIZE);
-#endif
+       memset(fb + sb.st_size, 0, YYMAXFILL);
+
+       if (P->input.buffer) {
+               free(P->input.buffer);
+       }
+       P->input.buffer = fb;
+       P->input.length = sb.st_size;
 
        P->file.fn = strdup(filename);
 
+       psi_parser_reset(P);
+
        return true;
 }
 
 bool psi_parser_open_string(struct psi_parser *P, const char *string, size_t length)
 {
-       P->input.type = PSI_PARSE_STRING;
-       P->input.data.string.length = length;
-       if (!(P->input.data.string.buffer = strndup(string, length))) {
+       char *sb;
+
+       if (!(sb = malloc(length + YYMAXFILL))) {
+               P->error(PSI_DATA(P), NULL, PSI_WARNING,
+                               "Could not allocate %zu bytes: %s",
+                               length + YYMAXFILL, strerror(errno));
                return false;
        }
 
+       memcpy(sb, string, length);
+       memset(sb + length, 0, YYMAXFILL);
+
+       if (P->input.buffer) {
+               free(P->input.buffer);
+       }
+       P->input.buffer = sb;
+       P->input.length = length;
+
        P->file.fn = strdup("<input>");
 
+       psi_parser_reset(P);
+
        return true;
 }
 
-static ssize_t psi_parser_fill(struct psi_parser *P, size_t n)
+#if 0
+static void psi_parser_register_constants(struct psi_parser *P)
 {
-       PSI_DEBUG_PRINT(P, "PSI< Fill: n=%zu (input.type=%d)\n", n, P->input.type);
+       zend_string *key;
+       zval *val;
 
-       /* init if n==0 */
-       if (!n) {
-               switch (P->input.type) {
-               case PSI_PARSE_FILE:
-                       P->cur = P->tok = P->mrk = P->input.data.file.buffer;
-#if HAVE_MMAP
-                       P->eof = P->input.data.file.buffer + P->input.data.file.length;
-                       P->lim = P->eof;
-#else
-                       P->eof = NULL;
-                       P->lim = P->input.data.file.buffer;
-#endif
-                       break;
+       ZEND_HASH_FOREACH_STR_KEY_VAL(&P->cpp.defs, key, val)
+       {
+               struct psi_impl_def_val *iv;
+               struct psi_const_type *ct;
+               struct psi_const *c;
+               const char *ctn;
+               token_t ctt;
+               impl_val tmp;
+               zend_string *str;
 
-               case PSI_PARSE_STRING:
-                       P->cur = P->tok = P->mrk = P->input.data.string.buffer;
-                       P->eof = P->input.data.string.buffer + P->input.data.string.length;
-                       P->lim = P->eof;
+               ZVAL_DEREF(val);
+               switch (Z_TYPE_P(val)) {
+               case IS_TRUE:
+               case IS_FALSE:
+                       ctt = PSI_T_BOOL;
+                       ctn = "bool";
+                       tmp.zend.bval = Z_TYPE_P(val) == IS_TRUE;
+                       break;
+               case IS_LONG:
+                       ctt = PSI_T_INT;
+                       ctn = "int";
+                       tmp.zend.lval = Z_LVAL_P(val);
+                       break;
+               case IS_DOUBLE:
+                       ctt = PSI_T_FLOAT;
+                       ctn = "float";
+                       tmp.dval = Z_DVAL_P(val);
+                       break;
+               default:
+                       ctt = PSI_T_STRING;
+                       ctn = "string";
+                       str = zval_get_string(val);
+                       tmp.zend.str = zend_string_dup(str, 1);
+                       zend_string_release(str);
                        break;
                }
 
-               PSI_DEBUG_PRINT(P, "PSI< Fill: cur=%p lim=%p eof=%p\n", P->cur, P->lim, P->eof);
+               iv = psi_impl_def_val_init(ctt, NULL);
+               iv->ival = tmp;
+               ct = psi_const_type_init(ctt, ctn);
+               c = psi_const_init(ct, key->val, iv);
+               if (!P->consts) {
+                       P->consts = psi_plist_init((psi_plist_dtor) psi_const_free);
+               }
+               P->consts = psi_plist_add(P->consts, &c);
        }
+       ZEND_HASH_FOREACH_END();
+}
+#endif
 
-       switch (P->input.type) {
-       case PSI_PARSE_STRING:
-               break;
+void psi_parser_parse(struct psi_parser *P)
+{
+       size_t i = 0;
+       struct psi_token *T;
 
-       case PSI_PARSE_FILE:
-#if !HAVE_MMAP
-               if (!P->eof) {
-                       size_t consumed = P->tok - P->buf;
-                       size_t reserved = P->lim - P->tok;
-                       size_t available = BSIZE - reserved;
-                       size_t didread;
+       P->cpp.tokens = psi_parser_scan(P);
 
-                       if (consumed) {
-                               memmove(P->buf, P->tok, reserved);
-                               P->tok -= consumed;
-                               P->cur -= consumed;
-                               P->lim -= consumed;
-                               P->mrk -= consumed;
-                       }
+       psi_cpp_preprocess(P, &P->cpp);
 
-                       didread = fread(P->lim, 1, available, P->fp);
-                       P->lim += didread;
-                       if (didread < available) {
-                               P->eof = P->lim;
+       if (psi_plist_count(P->cpp.tokens)) {
+               while (psi_plist_get(P->cpp.tokens, i++, &T)) {
+                       if (P->flags & PSI_DEBUG) {
+                               fprintf(stderr, "PSI> ");
+                               psi_token_dump(2, T);
                        }
-                       PSI_DEBUG_PRINT(P, "PSI< Fill: consumed=%zu reserved=%zu available=%zu didread=%zu\n",
-                                       consumed, reserved, available, didread);
+                       psi_parser_proc_parse(P->proc, T->type, T, P);
                }
-#endif
-               break;
-       }
-
-       PSI_DEBUG_PRINT(P, "PSI< Fill: avail=%td\n", P->lim - P->cur);
-
-       return P->lim - P->cur;
-}
-
-void psi_parser_parse(struct psi_parser *P, struct psi_token *T)
-{
-       if (T) {
-               psi_parser_proc_parse(P->proc, T->type, T, P);
-       } else {
                psi_parser_proc_parse(P->proc, 0, NULL, P);
        }
+
+       psi_plist_free(P->cpp.tokens);
+       P->cpp.tokens = NULL;
 }
 
 void psi_parser_dtor(struct psi_parser *P)
 {
        psi_parser_proc_free(&P->proc);
 
-       switch (P->input.type) {
-       case PSI_PARSE_FILE:
-               if (P->input.data.file.buffer) {
-#if HAVE_MMAP
-                       munmap(P->input.data.file.buffer, P->input.data.file.length);
-#else
-                       free(P->input.data.file.buffer);
-#endif
-               }
-               if (P->input.data.file.handle) {
-                       fclose(P->input.data.file.handle);
-               }
-               break;
-
-       case PSI_PARSE_STRING:
-               if (P->input.data.string.buffer) {
-                       free(P->input.data.string.buffer);
-               }
-               break;
+       if (P->input.buffer) {
+               free(P->input.buffer);
+               P->input.buffer = NULL;
        }
 
        psi_data_dtor(PSI_DATA(P));
 
+       zend_hash_destroy(&P->cpp.defs);
+
        memset(P, 0, sizeof(*P));
 }
 
@@ -224,42 +262,42 @@ void psi_parser_free(struct psi_parser **P)
        }
 }
 
-#define YYMAXFILL 12
-#if BSIZE < YYMAXFILL
-# error BSIZE must be greater than YYMAXFILL
-#endif
+#define NEWLINE() \
+       P->col = 1; \
+       ++P->line
 
-#define RETURN(t) do { \
+#define NEWTOKEN(t) \
        P->num = t; \
-       PSI_DEBUG_PRINT(P, "PSI< TOKEN: %d %.*s (EOF=%d %s:%u:%u)\n", \
-                               P->num, (int) (P->cur-P->tok), P->tok, P->num == PSI_T_EOF, \
-                               P->file.fn, P->line, P->col); \
-       return t; \
-} while(1)
-
-#define ADDCOLS \
-       P->col += P->cur - P->tok
+       token = psi_token_alloc(P); \
+       tokens = psi_plist_add(tokens, &token); \
+       P->col += P->cur - P->tok; \
+       if (P->flags & PSI_DEBUG) { \
+               fprintf(stderr, "PSI< "); \
+               psi_token_dump(2, token); \
+       } \
+       token = NULL
 
-#define NEWLINE(label) \
-       P->col = 1; \
-       ++P->line; \
-       goto label
 
-token_t psi_parser_scan(struct psi_parser *P)
+struct psi_plist *psi_parser_scan(struct psi_parser *P)
 {
+       struct psi_plist *tokens;
+       struct psi_token *token;
+
        if (!P->cur) {
-               psi_parser_fill(P, 0);
+               return NULL;
        }
-       for (;;) {
-               ADDCOLS;
-       nextline:
+
+       tokens = psi_plist_init(NULL);
+
+       start: ;
                P->tok = P->cur;
+
                
-#line 259 "src/parser.c"
+#line 297 "src/parser.c"
                {
                        unsigned char yych;
                        unsigned int yyaccept = 0;
-                       if ((P->lim - P->cur) < 12) { if (!psi_parser_fill(P,12)) RETURN(PSI_T_EOF); };
+                       if ((P->lim - P->cur) < 12) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
                        case '\t':
@@ -269,17 +307,17 @@ token_t psi_parser_scan(struct psi_parser *P)
                        case '!':       goto yy9;
                        case '"':       goto yy11;
                        case '#':       goto yy12;
-                       case '$':       goto yy13;
-                       case '%':       goto yy14;
-                       case '&':       goto yy16;
-                       case '(':       goto yy18;
-                       case ')':       goto yy20;
-                       case '*':       goto yy22;
-                       case '+':       goto yy24;
-                       case ',':       goto yy26;
-                       case '-':       goto yy28;
-                       case '.':       goto yy30;
-                       case '/':       goto yy31;
+                       case '$':       goto yy14;
+                       case '%':       goto yy15;
+                       case '&':       goto yy17;
+                       case '(':       goto yy19;
+                       case ')':       goto yy21;
+                       case '*':       goto yy23;
+                       case '+':       goto yy25;
+                       case ',':       goto yy27;
+                       case '-':       goto yy29;
+                       case '.':       goto yy31;
+                       case '/':       goto yy32;
                        case '0':
                        case '1':
                        case '2':
@@ -289,30 +327,29 @@ token_t psi_parser_scan(struct psi_parser *P)
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy33;
-                       case ':':       goto yy36;
-                       case ';':       goto yy38;
-                       case '<':       goto yy40;
-                       case '=':       goto yy42;
-                       case '>':       goto yy44;
+                       case '9':       goto yy34;
+                       case ':':       goto yy37;
+                       case ';':       goto yy39;
+                       case '<':       goto yy41;
+                       case '=':       goto yy43;
+                       case '>':       goto yy45;
                        case 'A':
-                       case 'a':       goto yy46;
+                       case 'a':       goto yy47;
                        case 'B':
-                       case 'b':       goto yy48;
+                       case 'b':       goto yy49;
                        case 'C':
-                       case 'c':       goto yy49;
+                       case 'c':       goto yy50;
                        case 'D':
-                       case 'd':       goto yy50;
+                       case 'd':       goto yy51;
                        case 'E':
-                       case 'e':       goto yy51;
+                       case 'e':       goto yy52;
                        case 'F':
-                       case 'f':       goto yy52;
+                       case 'f':       goto yy53;
                        case 'G':
                        case 'H':
                        case 'J':
                        case 'K':
                        case 'Q':
-                       case 'W':
                        case 'X':
                        case 'Y':
                        case '_':
@@ -321,52 +358,53 @@ token_t psi_parser_scan(struct psi_parser *P)
                        case 'j':
                        case 'k':
                        case 'q':
-                       case 'w':
                        case 'x':
-                       case 'y':       goto yy53;
+                       case 'y':       goto yy54;
                        case 'I':
-                       case 'i':       goto yy55;
+                       case 'i':       goto yy56;
                        case 'L':
-                       case 'l':       goto yy56;
+                       case 'l':       goto yy57;
                        case 'M':
-                       case 'm':       goto yy57;
+                       case 'm':       goto yy58;
                        case 'N':
-                       case 'n':       goto yy58;
+                       case 'n':       goto yy59;
                        case 'O':
-                       case 'o':       goto yy59;
+                       case 'o':       goto yy60;
                        case 'P':
-                       case 'p':       goto yy60;
+                       case 'p':       goto yy61;
                        case 'R':
-                       case 'r':       goto yy61;
+                       case 'r':       goto yy62;
                        case 'S':
-                       case 's':       goto yy62;
+                       case 's':       goto yy63;
                        case 'T':
-                       case 't':       goto yy63;
+                       case 't':       goto yy64;
                        case 'U':
-                       case 'u':       goto yy64;
+                       case 'u':       goto yy65;
                        case 'V':
-                       case 'v':       goto yy65;
+                       case 'v':       goto yy66;
+                       case 'W':
+                       case 'w':       goto yy67;
                        case 'Z':
-                       case 'z':       goto yy66;
-                       case '[':       goto yy67;
-                       case '\\':      goto yy69;
-                       case ']':       goto yy70;
-                       case '^':       goto yy72;
-                       case '{':       goto yy74;
-                       case '|':       goto yy76;
-                       case '}':       goto yy78;
-                       case '~':       goto yy80;
+                       case 'z':       goto yy68;
+                       case '[':       goto yy69;
+                       case '\\':      goto yy71;
+                       case ']':       goto yy73;
+                       case '^':       goto yy75;
+                       case '{':       goto yy77;
+                       case '|':       goto yy79;
+                       case '}':       goto yy81;
+                       case '~':       goto yy83;
                        default:        goto yy2;
                        }
 yy2:
                        ++P->cur;
 yy3:
-#line 371 "src/parser.re"
-                       {break;}
-#line 367 "src/parser.c"
+#line 426 "src/parser.re"
+                       { goto error; }
+#line 405 "src/parser.c"
 yy4:
                        ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
+                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
                        case '\t':
@@ -374,36 +412,37 @@ yy4:
                        default:        goto yy6;
                        }
 yy6:
-#line 306 "src/parser.re"
-                       { continue; }
-#line 380 "src/parser.c"
+#line 425 "src/parser.re"
+                       { NEWTOKEN(PSI_T_WHITESPACE); goto start; }
+#line 418 "src/parser.c"
 yy7:
                        ++P->cur;
-#line 305 "src/parser.re"
-                       { NEWLINE(nextline); }
-#line 385 "src/parser.c"
+#line 424 "src/parser.re"
+                       { NEWTOKEN(PSI_T_EOL); NEWLINE(); goto start; }
+#line 423 "src/parser.c"
 yy9:
                        ++P->cur;
                        switch ((yych = *P->cur)) {
-                       case '=':       goto yy82;
+                       case '=':       goto yy85;
                        default:        goto yy10;
                        }
 yy10:
-#line 290 "src/parser.re"
-                       {RETURN(PSI_T_NOT);}
-#line 395 "src/parser.c"
+#line 333 "src/parser.re"
+                       { NEWTOKEN(PSI_T_NOT); goto start; }
+#line 433 "src/parser.c"
 yy11:
                        yyaccept = 0;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '"':       goto yy3;
-                       default:        goto yy84;
+                       default:        goto yy87;
                        }
 yy12:
-                       yyaccept = 0;
-                       yych = *(P->mrk = ++P->cur);
-                       goto yy87;
-yy13:
+                       ++P->cur;
+#line 316 "src/parser.re"
+                       { NEWTOKEN(PSI_T_HASH); goto start; }
+#line 445 "src/parser.c"
+yy14:
                        yych = *++P->cur;
                        switch (yych) {
                        case '0':
@@ -468,44 +507,44 @@ yy13:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy90;
+                       case 'z':       goto yy89;
                        default:        goto yy3;
                        }
-yy14:
+yy15:
                        ++P->cur;
-#line 291 "src/parser.re"
-                       {RETURN(PSI_T_MODULO);}
-#line 479 "src/parser.c"
-yy16:
+#line 334 "src/parser.re"
+                       { NEWTOKEN(PSI_T_MODULO); goto start; }
+#line 518 "src/parser.c"
+yy17:
                        ++P->cur;
                        switch ((yych = *P->cur)) {
-                       case '&':       goto yy93;
-                       default:        goto yy17;
+                       case '&':       goto yy92;
+                       default:        goto yy18;
                        }
-yy17:
-#line 292 "src/parser.re"
-                       {RETURN(PSI_T_AMPERSAND);}
-#line 489 "src/parser.c"
 yy18:
+#line 335 "src/parser.re"
+                       { NEWTOKEN(PSI_T_AMPERSAND); goto start; }
+#line 528 "src/parser.c"
+yy19:
                        ++P->cur;
-#line 274 "src/parser.re"
-                       {RETURN(PSI_T_LPAREN);}
-#line 494 "src/parser.c"
-yy20:
+#line 317 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LPAREN); goto start; }
+#line 533 "src/parser.c"
+yy21:
                        ++P->cur;
-#line 275 "src/parser.re"
-                       {RETURN(PSI_T_RPAREN);}
-#line 499 "src/parser.c"
-yy22:
+#line 318 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RPAREN); goto start; }
+#line 538 "src/parser.c"
+yy23:
                        ++P->cur;
-#line 288 "src/parser.re"
-                       {RETURN(PSI_T_ASTERISK);}
-#line 504 "src/parser.c"
-yy24:
+#line 331 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ASTERISK); goto start; }
+#line 543 "src/parser.c"
+yy25:
                        yyaccept = 1;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case '.':       goto yy95;
+                       case '.':       goto yy94;
                        case '0':
                        case '1':
                        case '2':
@@ -515,23 +554,23 @@ yy24:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy33;
-                       default:        goto yy25;
+                       case '9':       goto yy34;
+                       default:        goto yy26;
                        }
-yy25:
-#line 293 "src/parser.re"
-                       {RETURN(PSI_T_PLUS);}
-#line 525 "src/parser.c"
 yy26:
+#line 336 "src/parser.re"
+                       { NEWTOKEN(PSI_T_PLUS); goto start; }
+#line 564 "src/parser.c"
+yy27:
                        ++P->cur;
-#line 277 "src/parser.re"
-                       {RETURN(PSI_T_COMMA);}
-#line 530 "src/parser.c"
-yy28:
+#line 320 "src/parser.re"
+                       { NEWTOKEN(PSI_T_COMMA); goto start; }
+#line 569 "src/parser.c"
+yy29:
                        yyaccept = 2;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case '.':       goto yy95;
+                       case '.':       goto yy94;
                        case '0':
                        case '1':
                        case '2':
@@ -541,18 +580,18 @@ yy28:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy33;
-                       default:        goto yy29;
+                       case '9':       goto yy34;
+                       default:        goto yy30;
                        }
-yy29:
-#line 294 "src/parser.re"
-                       {RETURN(PSI_T_MINUS);}
-#line 551 "src/parser.c"
 yy30:
+#line 337 "src/parser.re"
+                       { NEWTOKEN(PSI_T_MINUS); goto start; }
+#line 590 "src/parser.c"
+yy31:
                        yyaccept = 0;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case '.':       goto yy97;
+                       case '.':       goto yy96;
                        case '0':
                        case '1':
                        case '2':
@@ -562,28 +601,27 @@ yy30:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy98;
+                       case '9':       goto yy97;
                        default:        goto yy3;
                        }
-yy31:
-                       yyaccept = 3;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case '*':       goto yy100;
-                       case '/':       goto yy86;
-                       default:        goto yy32;
-                       }
 yy32:
-#line 295 "src/parser.re"
-                       {RETURN(PSI_T_SLASH);}
-#line 580 "src/parser.c"
+                       ++P->cur;
+                       switch ((yych = *P->cur)) {
+                       case '*':       goto yy99;
+                       case '/':       goto yy101;
+                       default:        goto yy33;
+                       }
 yy33:
-                       yyaccept = 4;
+#line 338 "src/parser.re"
+                       { NEWTOKEN(PSI_T_SLASH); goto start; }
+#line 618 "src/parser.c"
+yy34:
+                       yyaccept = 3;
                        P->mrk = ++P->cur;
-                       if ((P->lim - P->cur) < 3) { if (!psi_parser_fill(P,3)) RETURN(PSI_T_EOF); };
+                       if ((P->lim - P->cur) < 3) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
-                       case '.':       goto yy95;
+                       case '.':       goto yy94;
                        case '0':
                        case '1':
                        case '2':
@@ -593,125 +631,131 @@ yy33:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy33;
+                       case '9':       goto yy34;
                        case 'E':
-                       case 'e':       goto yy102;
-                       default:        goto yy35;
+                       case 'e':       goto yy103;
+                       default:        goto yy36;
                        }
-yy35:
-#line 366 "src/parser.re"
-                       {RETURN(PSI_T_NUMBER);}
-#line 605 "src/parser.c"
 yy36:
+#line 419 "src/parser.re"
+                       { NEWTOKEN(PSI_T_NUMBER); goto start; }
+#line 643 "src/parser.c"
+yy37:
                        ++P->cur;
-#line 278 "src/parser.re"
-                       {RETURN(PSI_T_COLON);}
-#line 610 "src/parser.c"
-yy38:
+#line 321 "src/parser.re"
+                       { NEWTOKEN(PSI_T_COLON); goto start; }
+#line 648 "src/parser.c"
+yy39:
                        ++P->cur;
-#line 276 "src/parser.re"
-                       {RETURN(PSI_T_EOS);}
-#line 615 "src/parser.c"
-yy40:
+#line 319 "src/parser.re"
+                       { NEWTOKEN(PSI_T_EOS); goto start; }
+#line 653 "src/parser.c"
+yy41:
                        ++P->cur;
                        switch ((yych = *P->cur)) {
-                       case '<':       goto yy103;
-                       case '=':       goto yy105;
-                       default:        goto yy41;
+                       case '<':       goto yy104;
+                       case '=':       goto yy106;
+                       default:        goto yy42;
                        }
-yy41:
-#line 302 "src/parser.re"
-                       {RETURN(PSI_T_LCHEVR);}
-#line 626 "src/parser.c"
 yy42:
+#line 346 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LCHEVR); goto start; }
+#line 664 "src/parser.c"
+yy43:
                        ++P->cur;
                        switch ((yych = *P->cur)) {
-                       case '=':       goto yy107;
-                       default:        goto yy43;
+                       case '=':       goto yy108;
+                       default:        goto yy44;
                        }
-yy43:
-#line 287 "src/parser.re"
-                       {RETURN(PSI_T_EQUALS);}
-#line 636 "src/parser.c"
 yy44:
+#line 330 "src/parser.re"
+                       { NEWTOKEN(PSI_T_EQUALS); goto start; }
+#line 674 "src/parser.c"
+yy45:
                        ++P->cur;
                        switch ((yych = *P->cur)) {
-                       case '=':       goto yy109;
-                       case '>':       goto yy111;
-                       default:        goto yy45;
+                       case '=':       goto yy110;
+                       case '>':       goto yy112;
+                       default:        goto yy46;
                        }
-yy45:
-#line 303 "src/parser.re"
-                       {RETURN(PSI_T_RCHEVR);}
-#line 647 "src/parser.c"
 yy46:
-                       yyaccept = 5;
+#line 347 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RCHEVR); goto start; }
+#line 685 "src/parser.c"
+yy47:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'R':
-                       case 'r':       goto yy113;
-                       default:        goto yy54;
+                       case 'r':       goto yy114;
+                       default:        goto yy55;
                        }
-yy47:
-#line 367 "src/parser.re"
-                       {RETURN(PSI_T_NAME);}
-#line 659 "src/parser.c"
 yy48:
-                       yyaccept = 5;
+#line 420 "src/parser.re"
+                       { NEWTOKEN(PSI_T_NAME); goto start; }
+#line 697 "src/parser.c"
+yy49:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy115;
-                       default:        goto yy54;
+                       case 'o':       goto yy116;
+                       default:        goto yy55;
                        }
-yy49:
-                       yyaccept = 5;
+yy50:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy116;
+                       case 'a':       goto yy117;
                        case 'H':
-                       case 'h':       goto yy117;
+                       case 'h':       goto yy118;
                        case 'O':
-                       case 'o':       goto yy118;
-                       default:        goto yy54;
+                       case 'o':       goto yy119;
+                       default:        goto yy55;
                        }
-yy50:
-                       yyaccept = 5;
+yy51:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy120;
                        case 'O':
-                       case 'o':       goto yy119;
-                       default:        goto yy54;
+                       case 'o':       goto yy121;
+                       default:        goto yy55;
                        }
-yy51:
-                       yyaccept = 5;
+yy52:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
+                       case 'L':
+                       case 'l':       goto yy122;
                        case 'N':
-                       case 'n':       goto yy120;
-                       default:        goto yy54;
+                       case 'n':       goto yy123;
+                       case 'R':
+                       case 'r':       goto yy124;
+                       default:        goto yy55;
                        }
-yy52:
-                       yyaccept = 5;
+yy53:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy121;
+                       case 'a':       goto yy125;
                        case 'L':
-                       case 'l':       goto yy122;
+                       case 'l':       goto yy126;
                        case 'R':
-                       case 'r':       goto yy123;
+                       case 'r':       goto yy127;
                        case 'U':
-                       case 'u':       goto yy124;
-                       default:        goto yy54;
+                       case 'u':       goto yy128;
+                       default:        goto yy55;
                        }
-yy53:
-                       yyaccept = 5;
+yy54:
+                       yyaccept = 4;
                        P->mrk = ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
+                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
-yy54:
+yy55:
                        switch (yych) {
                        case '0':
                        case '1':
@@ -775,136 +819,146 @@ yy54:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy47;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy48;
                        }
-yy55:
-                       yyaccept = 5;
+yy56:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
+                       case 'F':
+                       case 'f':       goto yy129;
                        case 'N':
-                       case 'n':       goto yy125;
-                       default:        goto yy54;
+                       case 'n':       goto yy131;
+                       default:        goto yy55;
                        }
-yy56:
-                       yyaccept = 5;
+yy57:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy126;
+                       case 'e':       goto yy132;
                        case 'I':
-                       case 'i':       goto yy127;
+                       case 'i':       goto yy133;
                        case 'O':
-                       case 'o':       goto yy128;
-                       default:        goto yy54;
+                       case 'o':       goto yy134;
+                       default:        goto yy55;
                        }
-yy57:
-                       yyaccept = 5;
+yy58:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy129;
-                       default:        goto yy54;
+                       case 'i':       goto yy135;
+                       default:        goto yy55;
                        }
-yy58:
-                       yyaccept = 5;
+yy59:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'U':
-                       case 'u':       goto yy130;
-                       default:        goto yy54;
+                       case 'u':       goto yy136;
+                       default:        goto yy55;
                        }
-yy59:
-                       yyaccept = 5;
+yy60:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'B':
-                       case 'b':       goto yy131;
-                       default:        goto yy54;
+                       case 'b':       goto yy137;
+                       default:        goto yy55;
                        }
-yy60:
-                       yyaccept = 5;
+yy61:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy132;
+                       case 'a':       goto yy138;
                        case 'O':
-                       case 'o':       goto yy133;
+                       case 'o':       goto yy139;
                        case 'R':
-                       case 'r':       goto yy134;
-                       default:        goto yy54;
+                       case 'r':       goto yy140;
+                       default:        goto yy55;
                        }
-yy61:
-                       yyaccept = 5;
+yy62:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy135;
-                       default:        goto yy54;
+                       case 'e':       goto yy141;
+                       default:        goto yy55;
                        }
-yy62:
-                       yyaccept = 5;
+yy63:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy136;
+                       case 'e':       goto yy142;
                        case 'H':
-                       case 'h':       goto yy137;
+                       case 'h':       goto yy143;
                        case 'I':
-                       case 'i':       goto yy138;
+                       case 'i':       goto yy144;
                        case 'T':
-                       case 't':       goto yy139;
-                       default:        goto yy54;
+                       case 't':       goto yy145;
+                       default:        goto yy55;
                        }
-yy63:
-                       yyaccept = 5;
+yy64:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy140;
+                       case 'e':       goto yy146;
                        case 'O':
-                       case 'o':       goto yy141;
+                       case 'o':       goto yy147;
                        case 'R':
-                       case 'r':       goto yy142;
+                       case 'r':       goto yy148;
                        case 'Y':
-                       case 'y':       goto yy143;
-                       default:        goto yy54;
+                       case 'y':       goto yy149;
+                       default:        goto yy55;
                        }
-yy64:
-                       yyaccept = 5;
+yy65:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy144;
+                       case 'i':       goto yy150;
                        case 'N':
-                       case 'n':       goto yy145;
-                       default:        goto yy54;
+                       case 'n':       goto yy151;
+                       default:        goto yy55;
                        }
-yy65:
-                       yyaccept = 5;
+yy66:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy146;
-                       default:        goto yy54;
+                       case 'o':       goto yy152;
+                       default:        goto yy55;
                        }
-yy66:
-                       yyaccept = 5;
+yy67:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy153;
+                       default:        goto yy55;
+                       }
+yy68:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'V':
-                       case 'v':       goto yy147;
-                       default:        goto yy54;
+                       case 'v':       goto yy154;
+                       default:        goto yy55;
                        }
-yy67:
-                       ++P->cur;
-#line 281 "src/parser.re"
-                       {RETURN(PSI_T_LBRACKET);}
-#line 905 "src/parser.c"
 yy69:
-                       yych = *++P->cur;
-                       switch (yych) {
+                       ++P->cur;
+#line 324 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LBRACKET); goto start; }
+#line 959 "src/parser.c"
+yy71:
+                       ++P->cur;
+                       switch ((yych = *P->cur)) {
                        case 'A':
                        case 'B':
                        case 'C':
@@ -957,74 +1011,64 @@ yy69:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy148;
-                       default:        goto yy3;
+                       case 'z':       goto yy155;
+                       default:        goto yy72;
                        }
-yy70:
-                       ++P->cur;
-#line 282 "src/parser.re"
-                       {RETURN(PSI_T_RBRACKET);}
-#line 968 "src/parser.c"
 yy72:
+#line 339 "src/parser.re"
+                       { NEWTOKEN(PSI_T_BSLASH); goto start; }
+#line 1021 "src/parser.c"
+yy73:
+                       ++P->cur;
+#line 325 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RBRACKET); goto start; }
+#line 1026 "src/parser.c"
+yy75:
                        ++P->cur;
-#line 297 "src/parser.re"
-                       {RETURN(PSI_T_CARET);}
-#line 973 "src/parser.c"
-yy74:
+#line 341 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CARET); goto start; }
+#line 1031 "src/parser.c"
+yy77:
                        ++P->cur;
-#line 279 "src/parser.re"
-                       {RETURN(PSI_T_LBRACE);}
-#line 978 "src/parser.c"
-yy76:
+#line 322 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LBRACE); goto start; }
+#line 1036 "src/parser.c"
+yy79:
                        ++P->cur;
                        switch ((yych = *P->cur)) {
-                       case '|':       goto yy151;
-                       default:        goto yy77;
+                       case '|':       goto yy158;
+                       default:        goto yy80;
                        }
-yy77:
-#line 296 "src/parser.re"
-                       {RETURN(PSI_T_PIPE);}
-#line 988 "src/parser.c"
-yy78:
-                       ++P->cur;
-#line 280 "src/parser.re"
-                       {RETURN(PSI_T_RBRACE);}
-#line 993 "src/parser.c"
 yy80:
+#line 340 "src/parser.re"
+                       { NEWTOKEN(PSI_T_PIPE); goto start; }
+#line 1046 "src/parser.c"
+yy81:
                        ++P->cur;
-#line 289 "src/parser.re"
-                       {RETURN(PSI_T_TILDE);}
-#line 998 "src/parser.c"
-yy82:
+#line 323 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RBRACE); goto start; }
+#line 1051 "src/parser.c"
+yy83:
                        ++P->cur;
-#line 283 "src/parser.re"
-                       {RETURN(PSI_T_CMP_NE);}
-#line 1003 "src/parser.c"
-yy84:
+#line 332 "src/parser.re"
+                       { NEWTOKEN(PSI_T_TILDE); goto start; }
+#line 1056 "src/parser.c"
+yy85:
                        ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
-                       yych = *P->cur;
-                       switch (yych) {
-                       case '"':       goto yy153;
-                       default:        goto yy84;
-                       }
-yy86:
+#line 326 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_NE); goto start; }
+#line 1061 "src/parser.c"
+yy87:
                        ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
+                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
-yy87:
                        switch (yych) {
-                       case '\n':      goto yy88;
-                       default:        goto yy86;
+                       case '"':       goto yy160;
+                       default:        goto yy87;
                        }
-yy88:
+yy89:
                        ++P->cur;
-#line 273 "src/parser.re"
-                       { NEWLINE(nextline); }
-#line 1025 "src/parser.c"
-yy90:
-                       ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
+                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
                        case '0':
@@ -1089,19 +1133,19 @@ yy90:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy90;
-                       default:        goto yy92;
+                       case 'z':       goto yy89;
+                       default:        goto yy91;
                        }
+yy91:
+#line 422 "src/parser.re"
+                       { NEWTOKEN(PSI_T_DOLLAR_NAME); goto start; }
+#line 1143 "src/parser.c"
 yy92:
-#line 369 "src/parser.re"
-                       {RETURN(PSI_T_DOLLAR_NAME);}
-#line 1099 "src/parser.c"
-yy93:
                        ++P->cur;
-#line 285 "src/parser.re"
-                       {RETURN(PSI_T_AND);}
-#line 1104 "src/parser.c"
-yy95:
+#line 328 "src/parser.re"
+                       { NEWTOKEN(PSI_T_AND); goto start; }
+#line 1148 "src/parser.c"
+yy94:
                        yych = *++P->cur;
                        switch (yych) {
                        case '0':
@@ -1113,89 +1157,99 @@ yy95:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy98;
-                       default:        goto yy96;
+                       case '9':       goto yy97;
+                       default:        goto yy95;
                        }
-yy96:
+yy95:
                        P->cur = P->mrk;
                        switch (yyaccept) {
                        case 0:         goto yy3;
-                       case 1:         goto yy25;
-                       case 2:         goto yy29;
-                       case 3:         goto yy32;
-                       case 4:         goto yy35;
-                       case 5:         goto yy47;
-                       case 6:         goto yy150;
-                       case 7:         goto yy173;
-                       case 8:         goto yy175;
-                       case 9:         goto yy177;
-                       case 10:        goto yy187;
-                       case 11:        goto yy204;
-                       case 12:        goto yy207;
-                       case 13:        goto yy212;
-                       case 14:        goto yy216;
-                       case 15:        goto yy224;
-                       case 16:        goto yy227;
-                       case 17:        goto yy242;
-                       case 18:        goto yy250;
-                       case 19:        goto yy256;
-                       case 20:        goto yy258;
-                       case 21:        goto yy260;
-                       case 22:        goto yy267;
-                       case 23:        goto yy269;
-                       case 24:        goto yy272;
-                       case 25:        goto yy274;
-                       case 26:        goto yy282;
-                       case 27:        goto yy290;
-                       case 28:        goto yy309;
-                       case 29:        goto yy312;
-                       case 30:        goto yy317;
-                       case 31:        goto yy319;
-                       case 32:        goto yy326;
-                       case 33:        goto yy328;
-                       case 34:        goto yy330;
-                       case 35:        goto yy332;
-                       case 36:        goto yy337;
-                       case 37:        goto yy339;
-                       case 38:        goto yy341;
-                       case 39:        goto yy343;
-                       case 40:        goto yy345;
-                       case 41:        goto yy347;
-                       case 42:        goto yy349;
-                       case 43:        goto yy354;
-                       case 44:        goto yy364;
-                       case 45:        goto yy370;
-                       case 46:        goto yy372;
-                       case 47:        goto yy374;
-                       case 48:        goto yy376;
-                       case 49:        goto yy381;
-                       case 50:        goto yy386;
-                       case 51:        goto yy391;
-                       case 52:        goto yy394;
-                       case 53:        goto yy396;
-                       case 54:        goto yy398;
-                       case 55:        goto yy400;
-                       case 56:        goto yy404;
-                       case 57:        goto yy406;
-                       case 58:        goto yy410;
-                       case 59:        goto yy412;
-                       case 60:        goto yy414;
-                       case 61:        goto yy416;
-                       case 62:        goto yy420;
-                       case 63:        goto yy422;
-                       case 64:        goto yy425;
-                       default:        goto yy427;
+                       case 1:         goto yy26;
+                       case 2:         goto yy30;
+                       case 3:         goto yy36;
+                       case 4:         goto yy48;
+                       case 5:         goto yy130;
+                       case 6:         goto yy157;
+                       case 7:         goto yy187;
+                       case 8:         goto yy189;
+                       case 9:         goto yy191;
+                       case 10:        goto yy201;
+                       case 11:        goto yy220;
+                       case 12:        goto yy223;
+                       case 13:        goto yy229;
+                       case 14:        goto yy231;
+                       case 15:        goto yy234;
+                       case 16:        goto yy239;
+                       case 17:        goto yy249;
+                       case 18:        goto yy252;
+                       case 19:        goto yy267;
+                       case 20:        goto yy275;
+                       case 21:        goto yy282;
+                       case 22:        goto yy285;
+                       case 23:        goto yy287;
+                       case 24:        goto yy294;
+                       case 25:        goto yy296;
+                       case 26:        goto yy300;
+                       case 27:        goto yy302;
+                       case 28:        goto yy304;
+                       case 29:        goto yy306;
+                       case 30:        goto yy309;
+                       case 31:        goto yy317;
+                       case 32:        goto yy325;
+                       case 33:        goto yy344;
+                       case 34:        goto yy346;
+                       case 35:        goto yy350;
+                       case 36:        goto yy355;
+                       case 37:        goto yy357;
+                       case 38:        goto yy359;
+                       case 39:        goto yy363;
+                       case 40:        goto yy368;
+                       case 41:        goto yy370;
+                       case 42:        goto yy372;
+                       case 43:        goto yy374;
+                       case 44:        goto yy379;
+                       case 45:        goto yy381;
+                       case 46:        goto yy383;
+                       case 47:        goto yy385;
+                       case 48:        goto yy387;
+                       case 49:        goto yy389;
+                       case 50:        goto yy391;
+                       case 51:        goto yy396;
+                       case 52:        goto yy407;
+                       case 53:        goto yy411;
+                       case 54:        goto yy415;
+                       case 55:        goto yy417;
+                       case 56:        goto yy419;
+                       case 57:        goto yy421;
+                       case 58:        goto yy426;
+                       case 59:        goto yy431;
+                       case 60:        goto yy436;
+                       case 61:        goto yy439;
+                       case 62:        goto yy441;
+                       case 63:        goto yy443;
+                       case 64:        goto yy445;
+                       case 65:        goto yy447;
+                       case 66:        goto yy451;
+                       case 67:        goto yy453;
+                       case 68:        goto yy457;
+                       case 69:        goto yy459;
+                       case 70:        goto yy461;
+                       case 71:        goto yy463;
+                       case 72:        goto yy467;
+                       case 73:        goto yy469;
+                       case 74:        goto yy472;
+                       default:        goto yy474;
                        }
-yy97:
+yy96:
                        yych = *++P->cur;
                        switch (yych) {
-                       case '.':       goto yy155;
-                       default:        goto yy96;
+                       case '.':       goto yy162;
+                       default:        goto yy95;
                        }
-yy98:
-                       yyaccept = 4;
+yy97:
+                       yyaccept = 3;
                        P->mrk = ++P->cur;
-                       if ((P->lim - P->cur) < 3) { if (!psi_parser_fill(P,3)) RETURN(PSI_T_EOF); };
+                       if ((P->lim - P->cur) < 3) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
                        case '0':
@@ -1207,21 +1261,26 @@ yy98:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy98;
+                       case '9':       goto yy97;
                        case 'E':
-                       case 'e':       goto yy102;
-                       default:        goto yy35;
+                       case 'e':       goto yy103;
+                       default:        goto yy36;
                        }
-yy100:
+yy99:
                        ++P->cur;
-#line 272 "src/parser.re"
+#line 314 "src/parser.re"
                        { goto comment; }
-#line 1220 "src/parser.c"
-yy102:
+#line 1274 "src/parser.c"
+yy101:
+                       ++P->cur;
+#line 315 "src/parser.re"
+                       { goto comment_sl; }
+#line 1279 "src/parser.c"
+yy103:
                        yych = *++P->cur;
                        switch (yych) {
                        case '+':
-                       case '-':       goto yy157;
+                       case '-':       goto yy164;
                        case '0':
                        case '1':
                        case '2':
@@ -1231,45 +1290,45 @@ yy102:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy158;
-                       default:        goto yy96;
+                       case '9':       goto yy165;
+                       default:        goto yy95;
                        }
-yy103:
+yy104:
                        ++P->cur;
-#line 298 "src/parser.re"
-                       {RETURN(PSI_T_LSHIFT);}
-#line 1242 "src/parser.c"
-yy105:
+#line 342 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LSHIFT); goto start; }
+#line 1301 "src/parser.c"
+yy106:
                        ++P->cur;
-#line 300 "src/parser.re"
-                       {RETURN(PSI_T_CMP_LE);}
-#line 1247 "src/parser.c"
-yy107:
+#line 344 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_LE); goto start; }
+#line 1306 "src/parser.c"
+yy108:
                        ++P->cur;
-#line 284 "src/parser.re"
-                       {RETURN(PSI_T_CMP_EQ);}
-#line 1252 "src/parser.c"
-yy109:
+#line 327 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_EQ); goto start; }
+#line 1311 "src/parser.c"
+yy110:
                        ++P->cur;
-#line 301 "src/parser.re"
-                       {RETURN(PSI_T_CMP_GE);}
-#line 1257 "src/parser.c"
-yy111:
+#line 345 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_GE); goto start; }
+#line 1316 "src/parser.c"
+yy112:
                        ++P->cur;
-#line 299 "src/parser.re"
-                       {RETURN(PSI_T_RSHIFT);}
-#line 1262 "src/parser.c"
-yy113:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
+#line 343 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RSHIFT); goto start; }
+#line 1321 "src/parser.c"
+yy114:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'R':
-                       case 'r':       goto yy160;
-                       default:        goto yy54;
+                       case 'r':       goto yy167;
+                       default:        goto yy55;
                        }
-yy114:
+yy115:
                        ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
+                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
                        case 'A':
@@ -1324,282 +1383,394 @@ yy114:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy148;
-                       default:        goto yy96;
+                       case 'z':       goto yy155;
+                       default:        goto yy95;
                        }
-yy115:
-                       yyaccept = 5;
+yy116:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy161;
-                       default:        goto yy54;
+                       case 'o':       goto yy168;
+                       default:        goto yy55;
                        }
-yy116:
-                       yyaccept = 5;
+yy117:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy162;
-                       default:        goto yy54;
+                       case 'l':       goto yy169;
+                       default:        goto yy55;
                        }
-yy117:
-                       yyaccept = 5;
+yy118:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy163;
-                       default:        goto yy54;
+                       case 'a':       goto yy170;
+                       default:        goto yy55;
                        }
-yy118:
-                       yyaccept = 5;
+yy119:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy164;
+                       case 'n':       goto yy171;
                        case 'U':
-                       case 'u':       goto yy165;
-                       default:        goto yy54;
+                       case 'u':       goto yy172;
+                       default:        goto yy55;
                        }
-yy119:
-                       yyaccept = 5;
+yy120:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'F':
+                       case 'f':       goto yy173;
+                       default:        goto yy55;
+                       }
+yy121:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'U':
-                       case 'u':       goto yy166;
-                       default:        goto yy54;
+                       case 'u':       goto yy174;
+                       default:        goto yy55;
                        }
-yy120:
-                       yyaccept = 5;
+yy122:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'I':
+                       case 'i':       goto yy175;
+                       case 'S':
+                       case 's':       goto yy176;
+                       default:        goto yy55;
+                       }
+yy123:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
+                       case 'D':
+                       case 'd':       goto yy177;
                        case 'U':
-                       case 'u':       goto yy167;
-                       default:        goto yy54;
+                       case 'u':       goto yy178;
+                       default:        goto yy55;
                        }
-yy121:
-                       yyaccept = 5;
+yy124:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'R':
+                       case 'r':       goto yy179;
+                       default:        goto yy55;
+                       }
+yy125:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy168;
-                       default:        goto yy54;
+                       case 'l':       goto yy180;
+                       default:        goto yy55;
                        }
-yy122:
-                       yyaccept = 5;
+yy126:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy169;
-                       default:        goto yy54;
+                       case 'o':       goto yy181;
+                       default:        goto yy55;
                        }
-yy123:
-                       yyaccept = 5;
+yy127:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy170;
-                       default:        goto yy54;
+                       case 'e':       goto yy182;
+                       default:        goto yy55;
                        }
-yy124:
-                       yyaccept = 5;
+yy128:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy171;
-                       default:        goto yy54;
+                       case 'n':       goto yy183;
+                       default:        goto yy55;
                        }
-yy125:
+yy129:
                        yyaccept = 5;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case 'D':
+                       case 'd':       goto yy184;
+                       case 'N':
+                       case 'n':       goto yy185;
+                       case '\\':      goto yy115;
+                       default:        goto yy130;
+                       }
+yy130:
+#line 349 "src/parser.re"
+                       { NEWTOKEN(PSI_T_IF); goto start; }
+#line 1573 "src/parser.c"
+yy131:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
                        case 'T':
-                       case 't':       goto yy172;
-                       default:        goto yy54;
+                       case 't':       goto yy186;
+                       default:        goto yy55;
                        }
-yy126:
-                       yyaccept = 5;
+yy132:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy174;
-                       default:        goto yy54;
+                       case 't':       goto yy188;
+                       default:        goto yy55;
                        }
-yy127:
-                       yyaccept = 5;
+yy133:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'B':
-                       case 'b':       goto yy176;
-                       default:        goto yy54;
+                       case 'b':       goto yy190;
+                       default:        goto yy55;
                        }
-yy128:
-                       yyaccept = 5;
+yy134:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy178;
-                       default:        goto yy54;
+                       case 'n':       goto yy192;
+                       default:        goto yy55;
                        }
-yy129:
-                       yyaccept = 5;
+yy135:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'X':
-                       case 'x':       goto yy179;
-                       default:        goto yy54;
+                       case 'x':       goto yy193;
+                       default:        goto yy55;
                        }
-yy130:
-                       yyaccept = 5;
+yy136:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy180;
-                       default:        goto yy54;
+                       case 'l':       goto yy194;
+                       default:        goto yy55;
                        }
-yy131:
-                       yyaccept = 5;
+yy137:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'J':
-                       case 'j':       goto yy181;
-                       default:        goto yy54;
+                       case 'j':       goto yy195;
+                       default:        goto yy55;
                        }
-yy132:
-                       yyaccept = 5;
+yy138:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy182;
-                       default:        goto yy54;
+                       case 't':       goto yy196;
+                       default:        goto yy55;
                        }
-yy133:
-                       yyaccept = 5;
+yy139:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'S':
-                       case 's':       goto yy183;
-                       default:        goto yy54;
+                       case 's':       goto yy197;
+                       default:        goto yy55;
                        }
-yy134:
-                       yyaccept = 5;
+yy140:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy184;
-                       default:        goto yy54;
+                       case 'e':       goto yy198;
+                       default:        goto yy55;
                        }
-yy135:
-                       yyaccept = 5;
+yy141:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy185;
-                       default:        goto yy54;
+                       case 't':       goto yy199;
+                       default:        goto yy55;
                        }
-yy136:
-                       yyaccept = 5;
+yy142:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy186;
-                       default:        goto yy54;
+                       case 't':       goto yy200;
+                       default:        goto yy55;
                        }
-yy137:
-                       yyaccept = 5;
+yy143:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy188;
-                       default:        goto yy54;
+                       case 'o':       goto yy202;
+                       default:        goto yy55;
                        }
-yy138:
-                       yyaccept = 5;
+yy144:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'G':
-                       case 'g':       goto yy189;
-                       default:        goto yy54;
+                       case 'g':       goto yy203;
+                       default:        goto yy55;
                        }
-yy139:
-                       yyaccept = 5;
+yy145:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy190;
+                       case 'a':       goto yy204;
                        case 'R':
-                       case 'r':       goto yy191;
-                       default:        goto yy54;
+                       case 'r':       goto yy205;
+                       default:        goto yy55;
                        }
-yy140:
-                       yyaccept = 5;
+yy146:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'M':
-                       case 'm':       goto yy192;
-                       default:        goto yy54;
+                       case 'm':       goto yy206;
+                       default:        goto yy55;
                        }
-yy141:
-                       yyaccept = 5;
+yy147:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case '_':       goto yy193;
-                       default:        goto yy54;
+                       case '_':       goto yy207;
+                       default:        goto yy55;
                        }
-yy142:
-                       yyaccept = 5;
+yy148:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'U':
-                       case 'u':       goto yy194;
-                       default:        goto yy54;
+                       case 'u':       goto yy208;
+                       default:        goto yy55;
                        }
-yy143:
-                       yyaccept = 5;
+yy149:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'P':
-                       case 'p':       goto yy195;
-                       default:        goto yy54;
+                       case 'p':       goto yy209;
+                       default:        goto yy55;
                        }
-yy144:
-                       yyaccept = 5;
+yy150:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy196;
-                       default:        goto yy54;
+                       case 'n':       goto yy210;
+                       default:        goto yy55;
                        }
-yy145:
-                       yyaccept = 5;
+yy151:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
+                       case 'D':
+                       case 'd':       goto yy211;
                        case 'I':
-                       case 'i':       goto yy197;
+                       case 'i':       goto yy212;
                        case 'S':
-                       case 's':       goto yy198;
-                       default:        goto yy54;
+                       case 's':       goto yy213;
+                       default:        goto yy55;
                        }
-yy146:
-                       yyaccept = 5;
+yy152:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy199;
-                       default:        goto yy54;
+                       case 'i':       goto yy214;
+                       default:        goto yy55;
                        }
-yy147:
-                       yyaccept = 5;
+yy153:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'R':
+                       case 'r':       goto yy215;
+                       default:        goto yy55;
+                       }
+yy154:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy200;
-                       default:        goto yy54;
+                       case 'a':       goto yy216;
+                       default:        goto yy55;
                        }
-yy148:
+yy155:
                        yyaccept = 6;
                        P->mrk = ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
+                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
                        case '0':
@@ -1664,30 +1835,30 @@ yy148:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy148;
-                       case '\\':      goto yy114;
-                       default:        goto yy150;
+                       case 'z':       goto yy155;
+                       case '\\':      goto yy115;
+                       default:        goto yy157;
                        }
-yy150:
-#line 368 "src/parser.re"
-                       {RETURN(PSI_T_NSNAME);}
-#line 1675 "src/parser.c"
-yy151:
+yy157:
+#line 421 "src/parser.re"
+                       { NEWTOKEN(PSI_T_NSNAME); goto start; }
+#line 1846 "src/parser.c"
+yy158:
                        ++P->cur;
-#line 286 "src/parser.re"
-                       {RETURN(PSI_T_OR);}
-#line 1680 "src/parser.c"
-yy153:
+#line 329 "src/parser.re"
+                       { NEWTOKEN(PSI_T_OR); goto start; }
+#line 1851 "src/parser.c"
+yy160:
                        ++P->cur;
-#line 370 "src/parser.re"
-                       {RETURN(PSI_T_QUOTED_STRING);}
-#line 1685 "src/parser.c"
-yy155:
+#line 423 "src/parser.re"
+                       { NEWTOKEN(PSI_T_QUOTED_STRING); goto start; }
+#line 1856 "src/parser.c"
+yy162:
                        ++P->cur;
-#line 304 "src/parser.re"
-                       {RETURN(PSI_T_ELLIPSIS);}
-#line 1690 "src/parser.c"
-yy157:
+#line 348 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ELLIPSIS); goto start; }
+#line 1861 "src/parser.c"
+yy164:
                        yych = *++P->cur;
                        switch (yych) {
                        case '0':
@@ -1699,12 +1870,12 @@ yy157:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy158;
-                       default:        goto yy96;
+                       case '9':       goto yy165;
+                       default:        goto yy95;
                        }
-yy158:
+yy165:
                        ++P->cur;
-                       if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); };
+                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
                        yych = *P->cur;
                        switch (yych) {
                        case '0':
@@ -1716,108 +1887,164 @@ yy158:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy158;
-                       default:        goto yy35;
+                       case '9':       goto yy165;
+                       default:        goto yy36;
                        }
-yy160:
-                       yyaccept = 5;
+yy167:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy201;
+                       case 'a':       goto yy217;
                        case 'V':
-                       case 'v':       goto yy202;
-                       default:        goto yy54;
+                       case 'v':       goto yy218;
+                       default:        goto yy55;
                        }
-yy161:
-                       yyaccept = 5;
+yy168:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy203;
-                       default:        goto yy54;
+                       case 'l':       goto yy219;
+                       default:        goto yy55;
                        }
-yy162:
-                       yyaccept = 5;
+yy169:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy205;
-                       default:        goto yy54;
+                       case 'l':       goto yy221;
+                       default:        goto yy55;
                        }
-yy163:
-                       yyaccept = 5;
+yy170:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'R':
-                       case 'r':       goto yy206;
-                       default:        goto yy54;
+                       case 'r':       goto yy222;
+                       default:        goto yy55;
                        }
-yy164:
-                       yyaccept = 5;
+yy171:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'S':
-                       case 's':       goto yy208;
-                       default:        goto yy54;
+                       case 's':       goto yy224;
+                       default:        goto yy55;
                        }
-yy165:
-                       yyaccept = 5;
+yy172:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy209;
-                       default:        goto yy54;
+                       case 'n':       goto yy225;
+                       default:        goto yy55;
                        }
-yy166:
-                       yyaccept = 5;
+yy173:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'I':
+                       case 'i':       goto yy226;
+                       default:        goto yy55;
+                       }
+yy174:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'B':
-                       case 'b':       goto yy210;
-                       default:        goto yy54;
+                       case 'b':       goto yy227;
+                       default:        goto yy55;
                        }
-yy167:
-                       yyaccept = 5;
+yy175:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'F':
+                       case 'f':       goto yy228;
+                       default:        goto yy55;
+                       }
+yy176:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy230;
+                       default:        goto yy55;
+                       }
+yy177:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'I':
+                       case 'i':       goto yy232;
+                       default:        goto yy55;
+                       }
+yy178:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'M':
-                       case 'm':       goto yy211;
-                       default:        goto yy54;
+                       case 'm':       goto yy233;
+                       default:        goto yy55;
                        }
-yy168:
-                       yyaccept = 5;
+yy179:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'O':
+                       case 'o':       goto yy235;
+                       default:        goto yy55;
+                       }
+yy180:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'S':
-                       case 's':       goto yy213;
-                       default:        goto yy54;
+                       case 's':       goto yy236;
+                       default:        goto yy55;
                        }
-yy169:
-                       yyaccept = 5;
+yy181:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy214;
-                       default:        goto yy54;
+                       case 'a':       goto yy237;
+                       default:        goto yy55;
                        }
-yy170:
-                       yyaccept = 5;
+yy182:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy215;
-                       default:        goto yy54;
+                       case 'e':       goto yy238;
+                       default:        goto yy55;
                        }
-yy171:
-                       yyaccept = 5;
+yy183:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'C':
-                       case 'c':       goto yy217;
-                       default:        goto yy54;
+                       case 'c':       goto yy240;
+                       default:        goto yy55;
                        }
-yy172:
+yy184:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy241;
+                       default:        goto yy55;
+                       }
+yy185:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'D':
+                       case 'd':       goto yy242;
+                       default:        goto yy55;
+                       }
+yy186:
                        yyaccept = 7;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
@@ -1877,21 +2104,21 @@ yy172:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '1':       goto yy218;
-                       case '3':       goto yy219;
-                       case '6':       goto yy220;
-                       case '8':       goto yy221;
+                       case 'z':       goto yy54;
+                       case '1':       goto yy243;
+                       case '3':       goto yy244;
+                       case '6':       goto yy245;
+                       case '8':       goto yy246;
                        case 'V':
-                       case 'v':       goto yy222;
-                       case '\\':      goto yy114;
-                       default:        goto yy173;
+                       case 'v':       goto yy247;
+                       case '\\':      goto yy115;
+                       default:        goto yy187;
                        }
-yy173:
-#line 316 "src/parser.re"
-                       {RETURN(PSI_T_INT);}
-#line 1894 "src/parser.c"
-yy174:
+yy187:
+#line 369 "src/parser.re"
+                       { NEWTOKEN(PSI_T_INT); goto start; }
+#line 2121 "src/parser.c"
+yy188:
                        yyaccept = 8;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
@@ -1957,15 +2184,15 @@ yy174:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy175;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy189;
                        }
-yy175:
-#line 342 "src/parser.re"
-                       {RETURN(PSI_T_LET);}
-#line 1968 "src/parser.c"
-yy176:
+yy189:
+#line 395 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LET); goto start; }
+#line 2195 "src/parser.c"
+yy190:
                        yyaccept = 9;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
@@ -2031,81 +2258,1268 @@ yy176:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy177;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy191;
                        }
-yy177:
-#line 341 "src/parser.re"
-                       {RETURN(PSI_T_LIB);}
-#line 2042 "src/parser.c"
-yy178:
-                       yyaccept = 5;
+yy191:
+#line 394 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LIB); goto start; }
+#line 2269 "src/parser.c"
+yy192:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'G':
-                       case 'g':       goto yy223;
-                       default:        goto yy54;
+                       case 'g':       goto yy248;
+                       default:        goto yy55;
                        }
-yy179:
-                       yyaccept = 5;
+yy193:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy225;
-                       default:        goto yy54;
+                       case 'e':       goto yy250;
+                       default:        goto yy55;
                        }
-yy180:
-                       yyaccept = 5;
+yy194:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy226;
-                       default:        goto yy54;
+                       case 'l':       goto yy251;
+                       default:        goto yy55;
                        }
-yy181:
-                       yyaccept = 5;
+yy195:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy253;
+                       case 'V':
+                       case 'v':       goto yy254;
+                       default:        goto yy55;
+                       }
+yy196:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'H':
+                       case 'h':       goto yy255;
+                       default:        goto yy55;
+                       }
+yy197:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy256;
+                       default:        goto yy55;
+                       }
+yy198:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '_':       goto yy257;
+                       default:        goto yy55;
+                       }
+yy199:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'U':
+                       case 'u':       goto yy258;
+                       default:        goto yy55;
+                       }
+yy200:
+                       yyaccept = 10;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy201;
+                       }
+yy201:
+#line 396 "src/parser.re"
+                       { NEWTOKEN(PSI_T_SET); goto start; }
+#line 2408 "src/parser.c"
+yy202:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'R':
+                       case 'r':       goto yy259;
+                       default:        goto yy55;
+                       }
+yy203:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'N':
+                       case 'n':       goto yy260;
+                       default:        goto yy55;
+                       }
+yy204:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy261;
+                       default:        goto yy55;
+                       }
+yy205:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'I':
+                       case 'i':       goto yy262;
+                       case 'L':
+                       case 'l':       goto yy263;
+                       case 'U':
+                       case 'u':       goto yy264;
+                       case 'V':
+                       case 'v':       goto yy265;
+                       default:        goto yy55;
+                       }
+yy206:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'P':
+                       case 'p':       goto yy266;
+                       default:        goto yy55;
+                       }
+yy207:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy268;
+                       case 'B':
+                       case 'b':       goto yy269;
+                       case 'F':
+                       case 'f':       goto yy270;
+                       case 'I':
+                       case 'i':       goto yy271;
+                       case 'O':
+                       case 'o':       goto yy272;
+                       case 'S':
+                       case 's':       goto yy273;
+                       default:        goto yy55;
+                       }
+yy208:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy274;
+                       default:        goto yy55;
+                       }
+yy209:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy276;
+                       default:        goto yy55;
+                       }
+yy210:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy277;
+                       default:        goto yy55;
+                       }
+yy211:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy278;
+                       default:        goto yy55;
+                       }
+yy212:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'O':
+                       case 'o':       goto yy279;
+                       default:        goto yy55;
+                       }
+yy213:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'I':
+                       case 'i':       goto yy280;
+                       default:        goto yy55;
+                       }
+yy214:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'D':
+                       case 'd':       goto yy281;
+                       default:        goto yy55;
+                       }
+yy215:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'N':
+                       case 'n':       goto yy283;
+                       default:        goto yy55;
+                       }
+yy216:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'L':
+                       case 'l':       goto yy284;
+                       default:        goto yy55;
+                       }
+yy217:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'Y':
+                       case 'y':       goto yy286;
+                       default:        goto yy55;
+                       }
+yy218:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy288;
+                       default:        goto yy55;
+                       }
+yy219:
+                       yyaccept = 11;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case 'V':
+                       case 'v':       goto yy289;
+                       case '\\':      goto yy115;
+                       default:        goto yy220;
+                       }
+yy220:
+#line 366 "src/parser.re"
+                       { NEWTOKEN(PSI_T_BOOL); goto start; }
+#line 2634 "src/parser.c"
+yy221:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy290;
+                       case 'B':
+                       case 'b':       goto yy291;
+                       case 'O':
+                       case 'o':       goto yy292;
+                       default:        goto yy55;
+                       }
+yy222:
+                       yyaccept = 12;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy223;
+                       }
+yy223:
+#line 367 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CHAR); goto start; }
+#line 2720 "src/parser.c"
+yy224:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy293;
+                       default:        goto yy55;
+                       }
+yy225:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy295;
+                       default:        goto yy55;
+                       }
+yy226:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'N':
+                       case 'n':       goto yy297;
+                       default:        goto yy55;
+                       }
+yy227:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'L':
+                       case 'l':       goto yy298;
+                       default:        goto yy55;
+                       }
+yy228:
+                       yyaccept = 13;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy229;
+                       }
+yy229:
+#line 353 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ELIF); goto start; }
+#line 2826 "src/parser.c"
+yy230:
+                       yyaccept = 14;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy231;
+                       }
+yy231:
+#line 352 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ELSE); goto start; }
+#line 2900 "src/parser.c"
+yy232:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'F':
+                       case 'f':       goto yy299;
+                       default:        goto yy55;
+                       }
+yy233:
+                       yyaccept = 15;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy234;
+                       }
+yy234:
+#line 392 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ENUM); goto start; }
+#line 2982 "src/parser.c"
+yy235:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'R':
+                       case 'r':       goto yy301;
+                       default:        goto yy55;
+                       }
+yy236:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy303;
+                       default:        goto yy55;
+                       }
+yy237:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy305;
+                       default:        goto yy55;
+                       }
+yy238:
+                       yyaccept = 16;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy239;
+                       }
+yy239:
+#line 400 "src/parser.re"
+                       { NEWTOKEN(PSI_T_FREE); goto start; }
+#line 3080 "src/parser.c"
+yy240:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy307;
+                       default:        goto yy55;
+                       }
+yy241:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'F':
+                       case 'f':       goto yy308;
+                       default:        goto yy55;
+                       }
+yy242:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy310;
+                       default:        goto yy55;
+                       }
+yy243:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '6':       goto yy311;
+                       default:        goto yy55;
+                       }
+yy244:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '2':       goto yy312;
+                       default:        goto yy55;
+                       }
+yy245:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '4':       goto yy313;
+                       default:        goto yy55;
+                       }
+yy246:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '_':       goto yy314;
+                       default:        goto yy55;
+                       }
+yy247:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy315;
+                       default:        goto yy55;
+                       }
+yy248:
+                       yyaccept = 17;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy249;
+                       }
+yy249:
+#line 370 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LONG); goto start; }
+#line 3214 "src/parser.c"
+yy250:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'D':
+                       case 'd':       goto yy316;
+                       default:        goto yy55;
+                       }
+yy251:
+                       yyaccept = 18;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy252;
+                       }
+yy252:
+#line 362 "src/parser.re"
+                       { NEWTOKEN(PSI_T_NULL); goto start; }
+#line 3296 "src/parser.c"
+yy253:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'C':
+                       case 'c':       goto yy318;
+                       default:        goto yy55;
+                       }
+yy254:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy319;
+                       default:        goto yy55;
+                       }
+yy255:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'V':
+                       case 'v':       goto yy320;
+                       default:        goto yy55;
+                       }
+yy256:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '_':       goto yy321;
+                       default:        goto yy55;
+                       }
+yy257:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy322;
+                       default:        goto yy55;
+                       }
+yy258:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'R':
+                       case 'r':       goto yy323;
+                       default:        goto yy55;
+                       }
+yy259:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'T':
+                       case 't':       goto yy324;
+                       default:        goto yy55;
+                       }
+yy260:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy326;
+                       default:        goto yy55;
+                       }
+yy261:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'I':
+                       case 'i':       goto yy327;
+                       default:        goto yy55;
+                       }
+yy262:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'N':
+                       case 'n':       goto yy328;
+                       default:        goto yy55;
+                       }
+yy263:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy329;
+                       default:        goto yy55;
+                       }
+yy264:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'C':
+                       case 'c':       goto yy330;
+                       default:        goto yy55;
+                       }
+yy265:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy331;
+                       default:        goto yy55;
+                       }
+yy266:
+                       yyaccept = 19;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'G':
+                       case 'H':
+                       case 'I':
+                       case 'J':
+                       case 'K':
+                       case 'L':
+                       case 'M':
+                       case 'N':
+                       case 'O':
+                       case 'P':
+                       case 'Q':
+                       case 'R':
+                       case 'S':
+                       case 'T':
+                       case 'U':
+                       case 'V':
+                       case 'W':
+                       case 'X':
+                       case 'Y':
+                       case 'Z':
+                       case '_':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':
+                       case 'g':
+                       case 'h':
+                       case 'i':
+                       case 'j':
+                       case 'k':
+                       case 'l':
+                       case 'm':
+                       case 'n':
+                       case 'o':
+                       case 'p':
+                       case 'q':
+                       case 'r':
+                       case 's':
+                       case 't':
+                       case 'u':
+                       case 'v':
+                       case 'w':
+                       case 'x':
+                       case 'y':
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy267;
+                       }
+yy267:
+#line 401 "src/parser.re"
+                       { NEWTOKEN(PSI_T_TEMP); goto start; }
+#line 3473 "src/parser.c"
+yy268:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'R':
+                       case 'r':       goto yy332;
+                       default:        goto yy55;
+                       }
+yy269:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'E':
-                       case 'e':       goto yy228;
-                       case 'V':
-                       case 'v':       goto yy229;
-                       default:        goto yy54;
+                       case 'O':
+                       case 'o':       goto yy333;
+                       default:        goto yy55;
                        }
-yy182:
-                       yyaccept = 5;
+yy270:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'H':
-                       case 'h':       goto yy230;
-                       default:        goto yy54;
+                       case 'L':
+                       case 'l':       goto yy334;
+                       default:        goto yy55;
                        }
-yy183:
-                       yyaccept = 5;
+yy271:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'T':
-                       case 't':       goto yy231;
-                       default:        goto yy54;
+                       case 'N':
+                       case 'n':       goto yy335;
+                       default:        goto yy55;
                        }
-yy184:
-                       yyaccept = 5;
+yy272:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case '_':       goto yy232;
-                       default:        goto yy54;
+                       case 'B':
+                       case 'b':       goto yy336;
+                       default:        goto yy55;
                        }
-yy185:
-                       yyaccept = 5;
+yy273:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'U':
-                       case 'u':       goto yy233;
-                       default:        goto yy54;
+                       case 'T':
+                       case 't':       goto yy337;
+                       default:        goto yy55;
                        }
-yy186:
-                       yyaccept = 10;
+yy274:
+                       yyaccept = 20;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -2170,152 +3584,58 @@ yy186:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy187;
-                       }
-yy187:
-#line 343 "src/parser.re"
-                       {RETURN(PSI_T_SET);}
-#line 2181 "src/parser.c"
-yy188:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'R':
-                       case 'r':       goto yy234;
-                       default:        goto yy54;
-                       }
-yy189:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'N':
-                       case 'n':       goto yy235;
-                       default:        goto yy54;
-                       }
-yy190:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'T':
-                       case 't':       goto yy236;
-                       default:        goto yy54;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy275;
                        }
-yy191:
-                       yyaccept = 5;
+yy275:
+#line 360 "src/parser.re"
+                       { NEWTOKEN(PSI_T_TRUE); goto start; }
+#line 3595 "src/parser.c"
+yy276:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'I':
-                       case 'i':       goto yy237;
-                       case 'L':
-                       case 'l':       goto yy238;
-                       case 'U':
-                       case 'u':       goto yy239;
-                       case 'V':
-                       case 'v':       goto yy240;
-                       default:        goto yy54;
+                       case 'D':
+                       case 'd':       goto yy338;
+                       default:        goto yy55;
                        }
-yy192:
-                       yyaccept = 5;
+yy277:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'P':
-                       case 'p':       goto yy241;
-                       default:        goto yy54;
+                       case '1':       goto yy339;
+                       case '3':       goto yy340;
+                       case '6':       goto yy341;
+                       case '8':       goto yy342;
+                       default:        goto yy55;
                        }
-yy193:
-                       yyaccept = 5;
+yy278:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'A':
-                       case 'a':       goto yy243;
-                       case 'B':
-                       case 'b':       goto yy244;
                        case 'F':
-                       case 'f':       goto yy245;
-                       case 'I':
-                       case 'i':       goto yy246;
-                       case 'O':
-                       case 'o':       goto yy247;
-                       case 'S':
-                       case 's':       goto yy248;
-                       default:        goto yy54;
-                       }
-yy194:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'E':
-                       case 'e':       goto yy249;
-                       default:        goto yy54;
-                       }
-yy195:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'E':
-                       case 'e':       goto yy251;
-                       default:        goto yy54;
-                       }
-yy196:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'T':
-                       case 't':       goto yy252;
-                       default:        goto yy54;
-                       }
-yy197:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'O':
-                       case 'o':       goto yy253;
-                       default:        goto yy54;
-                       }
-yy198:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'I':
-                       case 'i':       goto yy254;
-                       default:        goto yy54;
-                       }
-yy199:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'D':
-                       case 'd':       goto yy255;
-                       default:        goto yy54;
-                       }
-yy200:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'L':
-                       case 'l':       goto yy257;
-                       default:        goto yy54;
+                       case 'f':       goto yy343;
+                       default:        goto yy55;
                        }
-yy201:
-                       yyaccept = 5;
+yy279:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'Y':
-                       case 'y':       goto yy259;
-                       default:        goto yy54;
+                       case 'N':
+                       case 'n':       goto yy345;
+                       default:        goto yy55;
                        }
-yy202:
-                       yyaccept = 5;
+yy280:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'A':
-                       case 'a':       goto yy261;
-                       default:        goto yy54;
+                       case 'G':
+                       case 'g':       goto yy347;
+                       default:        goto yy55;
                        }
-yy203:
-                       yyaccept = 11;
+yy281:
+                       yyaccept = 21;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -2349,6 +3669,7 @@ yy203:
                        case 'S':
                        case 'T':
                        case 'U':
+                       case 'V':
                        case 'W':
                        case 'X':
                        case 'Y':
@@ -2375,33 +3696,28 @@ yy203:
                        case 's':
                        case 't':
                        case 'u':
+                       case 'v':
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case 'V':
-                       case 'v':       goto yy262;
-                       case '\\':      goto yy114;
-                       default:        goto yy204;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy282;
                        }
-yy204:
-#line 313 "src/parser.re"
-                       {RETURN(PSI_T_BOOL);}
-#line 2391 "src/parser.c"
-yy205:
-                       yyaccept = 5;
+yy282:
+#line 365 "src/parser.re"
+                       { NEWTOKEN(PSI_T_VOID); goto start; }
+#line 3711 "src/parser.c"
+yy283:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'A':
-                       case 'a':       goto yy263;
-                       case 'B':
-                       case 'b':       goto yy264;
-                       case 'O':
-                       case 'o':       goto yy265;
-                       default:        goto yy54;
+                       case 'I':
+                       case 'i':       goto yy348;
+                       default:        goto yy55;
                        }
-yy206:
-                       yyaccept = 12;
+yy284:
+                       yyaccept = 22;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -2466,40 +3782,16 @@ yy206:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy207;
-                       }
-yy207:
-#line 314 "src/parser.re"
-                       {RETURN(PSI_T_CHAR);}
-#line 2477 "src/parser.c"
-yy208:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'T':
-                       case 't':       goto yy266;
-                       default:        goto yy54;
-                       }
-yy209:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'T':
-                       case 't':       goto yy268;
-                       default:        goto yy54;
-                       }
-yy210:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'L':
-                       case 'l':       goto yy270;
-                       default:        goto yy54;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy285;
                        }
-yy211:
-                       yyaccept = 13;
+yy285:
+#line 410 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ZVAL); goto start; }
+#line 3793 "src/parser.c"
+yy286:
+                       yyaccept = 23;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -2564,32 +3856,56 @@ yy211:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy212;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy287;
                        }
-yy212:
-#line 339 "src/parser.re"
-                       {RETURN(PSI_T_ENUM);}
-#line 2575 "src/parser.c"
-yy213:
-                       yyaccept = 5;
+yy287:
+#line 384 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ARRAY); goto start; }
+#line 3867 "src/parser.c"
+yy288:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'E':
-                       case 'e':       goto yy271;
-                       default:        goto yy54;
+                       case 'L':
+                       case 'l':       goto yy349;
+                       default:        goto yy55;
                        }
-yy214:
-                       yyaccept = 5;
+yy289:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'T':
-                       case 't':       goto yy273;
-                       default:        goto yy54;
+                       case 'A':
+                       case 'a':       goto yy351;
+                       default:        goto yy55;
                        }
-yy215:
-                       yyaccept = 14;
+yy290:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'B':
+                       case 'b':       goto yy352;
+                       default:        goto yy55;
+                       }
+yy291:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'A':
+                       case 'a':       goto yy353;
+                       default:        goto yy55;
+                       }
+yy292:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'C':
+                       case 'c':       goto yy354;
+                       default:        goto yy55;
+                       }
+yy293:
+                       yyaccept = 24;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -2654,60 +3970,16 @@ yy215:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy216;
-                       }
-yy216:
-#line 347 "src/parser.re"
-                       {RETURN(PSI_T_FREE);}
-#line 2665 "src/parser.c"
-yy217:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'T':
-                       case 't':       goto yy275;
-                       default:        goto yy54;
-                       }
-yy218:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case '6':       goto yy276;
-                       default:        goto yy54;
-                       }
-yy219:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case '2':       goto yy277;
-                       default:        goto yy54;
-                       }
-yy220:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case '4':       goto yy278;
-                       default:        goto yy54;
-                       }
-yy221:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case '_':       goto yy279;
-                       default:        goto yy54;
-                       }
-yy222:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'A':
-                       case 'a':       goto yy280;
-                       default:        goto yy54;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy294;
                        }
-yy223:
-                       yyaccept = 15;
+yy294:
+#line 393 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CONST); goto start; }
+#line 3981 "src/parser.c"
+yy295:
+                       yyaccept = 25;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -2772,24 +4044,32 @@ yy223:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy224;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy296;
                        }
-yy224:
-#line 317 "src/parser.re"
-                       {RETURN(PSI_T_LONG);}
-#line 2783 "src/parser.c"
-yy225:
-                       yyaccept = 5;
+yy296:
+#line 411 "src/parser.re"
+                       { NEWTOKEN(PSI_T_COUNT); goto start; }
+#line 4055 "src/parser.c"
+yy297:
+                       yyaccept = 4;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
-                       case 'D':
-                       case 'd':       goto yy281;
-                       default:        goto yy54;
+                       case 'E':
+                       case 'e':       goto yy356;
+                       default:        goto yy55;
                        }
-yy226:
-                       yyaccept = 16;
+yy298:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy358;
+                       default:        goto yy55;
+                       }
+yy299:
+                       yyaccept = 26;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -2854,119 +4134,16 @@ yy226:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy227;
-                       }
-yy227:
-#line 309 "src/parser.re"
-                       {RETURN(PSI_T_NULL);}
-#line 2865 "src/parser.c"
-yy228:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'C':
-                       case 'c':       goto yy283;
-                       default:        goto yy54;
-                       }
-yy229:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'A':
-                       case 'a':       goto yy284;
-                       default:        goto yy54;
-                       }
-yy230:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'V':
-                       case 'v':       goto yy285;
-                       default:        goto yy54;
-                       }
-yy231:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case '_':       goto yy286;
-                       default:        goto yy54;
-                       }
-yy232:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'A':
-                       case 'a':       goto yy287;
-                       default:        goto yy54;
-                       }
-yy233:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'R':
-                       case 'r':       goto yy288;
-                       default:        goto yy54;
-                       }
-yy234:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'T':
-                       case 't':       goto yy289;
-                       default:        goto yy54;
-                       }
-yy235:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'E':
-                       case 'e':       goto yy291;
-                       default:        goto yy54;
-                       }
-yy236:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'I':
-                       case 'i':       goto yy292;
-                       default:        goto yy54;
-                       }
-yy237:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'N':
-                       case 'n':       goto yy293;
-                       default:        goto yy54;
-                       }
-yy238:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'E':
-                       case 'e':       goto yy294;
-                       default:        goto yy54;
-                       }
-yy239:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'C':
-                       case 'c':       goto yy295;
-                       default:        goto yy54;
-                       }
-yy240:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'A':
-                       case 'a':       goto yy296;
-                       default:        goto yy54;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy300;
                        }
-yy241:
-                       yyaccept = 17;
+yy300:
+#line 354 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ENDIF); goto start; }
+#line 4145 "src/parser.c"
+yy301:
+                       yyaccept = 27;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -3031,64 +4208,16 @@ yy241:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy242;
-                       }
-yy242:
-#line 348 "src/parser.re"
-                       {RETURN(PSI_T_TEMP);}
-#line 3042 "src/parser.c"
-yy243:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'R':
-                       case 'r':       goto yy297;
-                       default:        goto yy54;
-                       }
-yy244:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'O':
-                       case 'o':       goto yy298;
-                       default:        goto yy54;
-                       }
-yy245:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'L':
-                       case 'l':       goto yy299;
-                       default:        goto yy54;
-                       }
-yy246:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'N':
-                       case 'n':       goto yy300;
-                       default:        goto yy54;
-                       }
-yy247:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'B':
-                       case 'b':       goto yy301;
-                       default:        goto yy54;
-                       }
-yy248:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'T':
-                       case 't':       goto yy302;
-                       default:        goto yy54;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy302;
                        }
-yy249:
-                       yyaccept = 18;
+yy302:
+#line 359 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ERROR); goto start; }
+#line 4219 "src/parser.c"
+yy303:
+                       yyaccept = 28;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -3153,50 +4282,16 @@ yy249:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy250;
-                       }
-yy250:
-#line 307 "src/parser.re"
-                       {RETURN(PSI_T_TRUE);}
-#line 3164 "src/parser.c"
-yy251:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'D':
-                       case 'd':       goto yy303;
-                       default:        goto yy54;
-                       }
-yy252:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case '1':       goto yy304;
-                       case '3':       goto yy305;
-                       case '6':       goto yy306;
-                       case '8':       goto yy307;
-                       default:        goto yy54;
-                       }
-yy253:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'N':
-                       case 'n':       goto yy308;
-                       default:        goto yy54;
-                       }
-yy254:
-                       yyaccept = 5;
-                       yych = *(P->mrk = ++P->cur);
-                       switch (yych) {
-                       case 'G':
-                       case 'g':       goto yy310;
-                       default:        goto yy54;
+                       case 'z':       goto yy54;
+                       case '\\':      goto yy115;
+                       default:        goto yy304;
                        }
-yy255:
-                       yyaccept = 19;
+yy304:
+#line 361 "src/parser.re"
+                       { NEWTOKEN(PSI_T_FALSE); goto start; }
+#line 4293 "src/parser.c"
+yy305:
+                       yyaccept = 29;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -3230,7 +4325,6 @@ yy255:
                        case 'S':
                        case 'T':
                        case 'U':
-                       case 'V':
                        case 'W':
                        case 'X':
                        case 'Y':
@@ -3257,20 +4351,29 @@ yy255:
                        case 's':
                        case 't':
                        case 'u':
-                       case 'v':
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy53;
-                       case '\\':      goto yy114;
-                       default:        goto yy256;
+                       case 'z':       goto yy54;
+                       case 'V':
+                       case 'v':       goto yy360;
+                       case '\\':      goto yy115;
+                       default:        goto yy306;
                        }
-yy256:
-#line 312 "src/parser.re"
-                       {RETURN(PSI_T_VOID);}
-#line 3272 "src/parser.c"
-yy257:
-                       yyaccept = 20;
+yy306:
+#line 371 "src/parser.re"
+                       { NEWTOKEN(PSI_T_FLOAT); goto start; }
+#line 4367 "src/parser.c"
+yy307:
+                       yyaccept = 4;
+                       yych = *(P->mrk = ++P->cur);
+                       switch (yych) {
+                       case 'I':
+                       case 'i':       goto yy361;
+                       default:        goto yy55;
+                       }
+yy308:
+                       yyaccept = 30;
                        yych = *(P->mrk = ++P->cur);
                        switch (yych) {
                        case '0':
@@ -3335,16 +4438,61 @@ yy257:
                        case 'w':
                        case 'x':
     &n