bison
authorMichael Wallner <mike@php.net>
Tue, 7 Mar 2017 18:54:56 +0000 (19:54 +0100)
committerMichael Wallner <mike@php.net>
Wed, 3 May 2017 06:44:24 +0000 (08:44 +0200)
56 files changed:
.gitignore
Makefile.frag
TODO
config.m4
m4/psi/psi.m4
m4/psi/psi_type.m4
php_psi_cpp.h.in [new file with mode: 0644]
php_psi_posix.h.in
php_psi_stdinc.h.in
scripts/gen_calc_oper.php
src/calc/oper.h
src/context.c
src/cpp.c
src/cpp.h
src/cpp_tokiter.c
src/marshal.c
src/module.c
src/parser.c
src/parser.h
src/parser.re
src/parser_def.h [deleted file]
src/parser_proc.c
src/parser_proc.h
src/parser_proc.inc [deleted file]
src/parser_proc.y [deleted file]
src/parser_proc_def.h
src/parser_proc_grammar.y [new file with mode: 0644]
src/plist.c
src/plist.h
src/token.c
src/token.h
src/types/assert_stmt.h
src/types/cpp_exp.c
src/types/cpp_exp.h
src/types/cpp_macro_decl.c
src/types/cpp_macro_decl.h
src/types/decl_arg.c
src/types/decl_enum_item.c
src/types/decl_type.c
src/types/decl_type.h
src/types/num_exp.c
src/types/num_exp.h
src/types/number.c
tests/parser/cpp/define001.psi [deleted file]
tests/parser/cpp001.phpt [new file with mode: 0644]
tests/parser/dump/dump001.phpt [deleted file]
tests/parser/dump001.phpt [new file with mode: 0644]
tests/parser/enum/enum001.phpt [deleted file]
tests/parser/enum/enum001.psi [deleted file]
tests/parser/enum001.phpt [new file with mode: 0644]
tests/parser/validate001.phpt
tests/parser/validate002.phpt [new file with mode: 0644]
tests/parser/validate003.phpt [new file with mode: 0644]
tests/parser/validate004.phpt [new file with mode: 0644]
tests/parser/validate005.phpt [new file with mode: 0644]
tests/parser/validate006.phpt [new file with mode: 0644]

index 93a5b6c..ce94c07 100644 (file)
@@ -44,9 +44,6 @@ tests/*/*.sh
 /*.diff
 /*.phar
 /tmp/
-/lemon.c
-/lempar.c
-/lemon
 /context.h
 /libffi.h
 /libjit.h
@@ -61,8 +58,8 @@ tests/*/*.sh
 /parser_proc.h
 /token.h
 /types.h
-/src/parser_proc.out
+/src/parser_proc.output
 /php_psi_stdinc.h
 /php_psi_posix.h
 /types/
-/calc/
\ No newline at end of file
+/calc/
index 39ba8c0..7df00ad 100644 (file)
@@ -11,43 +11,19 @@ $(PHP_PSI_BUILDDIR)/types/%.h: $(PHP_PSI_SRCDIR)/src/types/%.h | $(PHP_PSI_BUILD
 $(PHP_PSI_BUILDDIR)/%.h: $(PHP_PSI_SRCDIR)/src/%.h
        @cat >$@ <$<
 
-$(PHP_PSI_BUILDDIR)/lempar.c:
-       curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lempar.c?name=db1bdb4821f2d8fbd76e577cf3ab18642c8d08d1"
-
-$(PHP_PSI_BUILDDIR)/lemon.c:
-       curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lemon.c?name=5ccba178a8e8a4b21e1c9232944d23973da38ad7"
-
-$(PHP_PSI_BUILDDIR)/lemon: $(PHP_PSI_BUILDDIR)/lemon.c | $(PHP_PSI_BUILDDIR)/lempar.c
-       $(CC) -o $@ $<
-
 $(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_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)
+$(PHP_PSI_SRCDIR)/src/parser_proc.c: $(PHP_PSI_SRCDIR)/src/parser_proc_grammar.y
        # trickery needed for relative #line directives
-       cd $(PHP_PSI_SRCDIR) && $(LEMON_PATH)$(LEMON) $(patsubst $(PHP_PSI_SRCDIR)/%,%,$<)
+       cd $(PHP_PSI_SRCDIR) && bison -Wall -v -d -o $(patsubst $(PHP_PSI_SRCDIR)/%,%,$@) $(patsubst $(PHP_PSI_SRCDIR)/%,%,$<)
 
 $(PHP_PSI_SRCDIR)/src/parser.re: $(PHP_PSI_SRCDIR)/src/parser_proc.h
        touch $@
 $(PHP_PSI_SRCDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re
        # trickery needed for relative #line directives
-       cd $(PHP_PSI_SRCDIR) && $(RE2C) -o $(patsubst $(PHP_PSI_SRCDIR)/%,%,$@) $(patsubst $(PHP_PSI_SRCDIR)/%,%,$<)
+       cd $(PHP_PSI_SRCDIR) && $(RE2C) -W -o $(patsubst $(PHP_PSI_SRCDIR)/%,%,$@) $(patsubst $(PHP_PSI_SRCDIR)/%,%,$<)
 
-$(PHP_PSI_SRCDIR)/src/calc/basic.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_basic.php
-       $(PHP_EXECUTABLE) $< >$@
-$(PHP_PSI_SRCDIR)/src/calc/bin.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_bin.php
-       $(PHP_EXECUTABLE) $< >$@
-$(PHP_PSI_SRCDIR)/src/calc/bool.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_bool.php
-       $(PHP_EXECUTABLE) $< >$@
-$(PHP_PSI_SRCDIR)/src/calc/cast.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_cast.php
-       $(PHP_EXECUTABLE) $< >$@
-$(PHP_PSI_SRCDIR)/src/calc/cmp.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_cmp.php
-       $(PHP_EXECUTABLE) $< >$@
-$(PHP_PSI_SRCDIR)/src/calc/oper.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_oper.php
+$(PHP_PSI_SRCDIR)/src/calc/%.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_%.php
        $(PHP_EXECUTABLE) $< >$@
 
 $(PHP_PSI_SRCDIR)/src/calc.h: | $(PHP_PSI_SRCDIR)/src/calc/basic.h $(PHP_PSI_SRCDIR)/src/calc/bin.h $(PHP_PSI_SRCDIR)/src/calc/bool.h $(PHP_PSI_SRCDIR)/src/calc/cast.h $(PHP_PSI_SRCDIR)/src/calc/cmp.h $(PHP_PSI_SRCDIR)/src/calc/oper.h
diff --git a/TODO b/TODO
index 502044b..5157da6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,4 +5,6 @@
 * pemalloc
 * CPP style #if(def(ined)) support in parser.re with a HashTable
 * think about a better system for EXTVARs, separate \set and \get functions are clunky
-* impl_def_val: allow num_exp
\ No newline at end of file
+* impl_def_val: allow num_exp
+* fix right recursion of let_exp and set_exp
+* numeral suffixes
\ No newline at end of file
index 5c8ed57..63458ad 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -91,7 +91,6 @@ if test "$PHP_PSI" != no; then
        AC_MSG_CHECKING([psi build dir])
        AC_MSG_RESULT([$PHP_PSI_BUILDDIR])
        
-       PSI_LEMON
        PSI_CHECK_LIBJIT
        PSI_CHECK_LIBFFI
 
@@ -174,7 +173,7 @@ if test "$PHP_PSI" != no; then
                )` \
        "
        PHP_PSI_GENERATED=" \
-               src/parser_proc.y src/parser_proc.c src/parser.c \
+               src/parser_proc.c src/parser.c \
                src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
                src/calc/cmp.h src/calc/oper.h \
        "
index f99d582..984aa60 100644 (file)
@@ -18,6 +18,42 @@ AC_DEFUN(PSI_CONFIG_INIT, [
                ])
                psi_cv_libc_main=$psi_libc_main
        ])
+       
+       AC_MSG_CHECKING(for preprocessor defaults)
+       psi_cpp_predef=`$CPP -Wp,-dM - </dev/null`
+       psi_cpp_search=`$CPP -Wp,-v - </dev/null 2>&1 >/dev/null \
+               | $AWK '
+                       /include.*search.*start/ { 
+                               capture = 1
+                               next
+                       }
+                       /[Ee]nd.*search/ {
+                               capture = 0
+                       }
+                       { 
+                               if (capture)
+                                       print $1
+                       }
+               ' \
+       `
+       psi_cpp_predef_count=`printf %s "$psi_cpp_predef" | wc -l`
+       psi_cpp_search_count=`printf %s "$psi_cpp_search" | wc -l`
+       AC_MSG_RESULT([$psi_cpp_predef_count predefined macros, and $psi_cpp_search_count search paths])
+       PSI_CPP_PREDEF=`printf "%s\n" "$psi_cpp_predef" | \
+               $AWK '{
+                       gsub(/"/, "\\\\\"");
+                       printf "\"%s\\\n\"\n", $[]0
+               }' \
+       `
+       PSI_CPP_SEARCH=`printf %s "$psi_cpp_search" | \
+               $AWK '{
+                       if (i) printf ":";
+                       gsub(/^@<:@@<:@:space:@:>@@:>@+/,"");
+                       gsub(/@<:@@<:@:space:@:>@@:>@+$/,"");
+                       printf "%s", $[]0;
+                       ++i
+               }' \
+       `
 
        if test "$PHP_PSI_MAINTAINER_MODE" = "yes"; then
                PSI_FAST_CONFIG=true
@@ -48,6 +84,7 @@ AC_DEFUN(PSI_CONFIG_INIT, [
        AC_CONFIG_FILES(
                [$PHP_PSI_BUILDDIR/php_psi_stdinc.h:$PHP_PSI_SRCDIR/php_psi_stdinc.h.in]
                [$PHP_PSI_BUILDDIR/php_psi_posix.h:$PHP_PSI_SRCDIR/php_psi_posix.h.in]
+               [$PHP_PSI_BUILDDIR/php_psi_cpp.h:$PHP_PSI_SRCDIR/php_psi_cpp.h.in]
        )
 
 ])
@@ -86,6 +123,8 @@ AC_DEFUN(PSI_CONFIG_DONE, [
        AC_SUBST([PSI_REDIRS])
        AC_SUBST([PSI_MACROS])
        AC_SUBST([PSI_DECLS])
+       AC_SUBST([PSI_CPP_SEARCH])
+       AC_SUBST([PSI_CPP_PREDEF])
 ])
 
 dnl PSI_SH_CONFIG_POSIX_ENABLED(section)
index 27aeeac..b3940a4 100644 (file)
@@ -243,8 +243,12 @@ AC_DEFUN(PSI_CHECK_STD_TYPES, [
        PSI_STDTYPE(short int, int)
        PSI_STDTYPE(signed short, int)
        PSI_STDTYPE(signed short int, int)
+       PSI_STDTYPE(short signed, int)
+       PSI_STDTYPE(short signed int, int)
        PSI_STDTYPE(unsigned short, uint)
        PSI_STDTYPE(unsigned short int, uint)
+       PSI_STDTYPE(short unsigned, uint)
+       PSI_STDTYPE(short unsigned int, uint)
        PSI_STDTYPE(int, int)
        AC_CHECK_ALIGNOF(int)
        PSI_STDTYPE(signed int, int)
@@ -255,14 +259,25 @@ AC_DEFUN(PSI_CHECK_STD_TYPES, [
        AC_CHECK_ALIGNOF(long)
        PSI_STDTYPE(long int, int)
        PSI_STDTYPE(signed long int, int)
+       PSI_STDTYPE(long signed int, int)
        PSI_STDTYPE(unsigned long, uint)
        PSI_STDTYPE(unsigned long int, uint)
+       PSI_STDTYPE(long unsigned, uint)
+       PSI_STDTYPE(long unsigned int, uint)
        PSI_STDTYPE(long long, int)
        AC_CHECK_ALIGNOF(long long)
        PSI_STDTYPE(signed long long, int)
        PSI_STDTYPE(signed long long int, int)
+       PSI_STDTYPE(long signed long, int)
+       PSI_STDTYPE(long signed long int, int)
+       PSI_STDTYPE(long long signed, int)
+       PSI_STDTYPE(long long signed int, int)
        PSI_STDTYPE(unsigned long long, uint)
        PSI_STDTYPE(unsigned long long int, uint)
+       PSI_STDTYPE(long unsigned long, uint)
+       PSI_STDTYPE(long unsigned long int, uint)
+       PSI_STDTYPE(long long unsigned, uint)
+       PSI_STDTYPE(long long unsigned int, uint)
        dnl this must come after the check for "unsigned long long int"; autoconf, wth?
        PSI_STDTYPE(long long int, int)
 ])
diff --git a/php_psi_cpp.h.in b/php_psi_cpp.h.in
new file mode 100644 (file)
index 0000000..3069ba4
--- /dev/null
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ Copyright (c) 2016, 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.
+*******************************************************************************/
+
+/* generated by configure */
+
+#ifdef PSI_CPP_SEARCH
+static const char psi_cpp_search[] = "@PSI_CPP_SEARCH@";
+#endif
+
+#ifdef PSI_CPP_PREDEF
+static const char psi_cpp_predef[] = ""
+@PSI_CPP_PREDEF@
+;
+#endif
index 1b2f07a..882e30c 100644 (file)
@@ -1,6 +1,29 @@
+/*******************************************************************************
+ Copyright (c) 2016, 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.
+*******************************************************************************/
+
 /* generated by configure */
-#ifndef PSI_POSIX_H
-#define PSI_POSIX_H
 
 #include "php_psi_stdinc.h"
 
@@ -92,4 +115,3 @@ static struct psi_func_redir {
 };
 #endif
 
-#endif
index 55c2f09..7bf0bd8 100644 (file)
@@ -1,4 +1,30 @@
+/*******************************************************************************
+ Copyright (c) 2016, 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.
+*******************************************************************************/
+
 /* generated by configure */
+
 #ifndef PSI_STDINC_H
 #define PSI_STDINC_H
 
index 126e9ac..b6e62aa 100644 (file)
@@ -3,7 +3,7 @@
 include __DIR__."/_include.php";
 
 $oper = [
-               ["NOT", "TILDE"],
+               ["NOT", "TILDE", "CAST"],
                ["ASTERISK", "SLASH", "MODULO"],
                ["PLUS", "MINUS"],
                ["LSHIFT", "RSHIFT"],
@@ -27,9 +27,9 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                return 1;
        } else if (op1 == op2) {
                return 0;
-       } else if (!op1) {
+       } else if (!op1 || op1 == PSI_T_NUMBER) {
                return 1;
-       } else if (!op2) {
+       } else if (!op2 || op2 == PSI_T_NUMBER) {
                return -1;
        }
 
index cf86b18..8208e30 100644 (file)
@@ -36,9 +36,9 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                return 1;
        } else if (op1 == op2) {
                return 0;
-       } else if (!op1) {
+       } else if (!op1 || op1 == PSI_T_NUMBER) {
                return 1;
-       } else if (!op2) {
+       } else if (!op2 || op2 == PSI_T_NUMBER) {
                return -1;
        }
 
@@ -49,6 +49,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 0;
                case PSI_T_TILDE:
                        return 0;
+               case PSI_T_CAST:
+                       return 0;
                case PSI_T_ASTERISK:
                        return -1;
                case PSI_T_SLASH:
@@ -97,6 +99,58 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 0;
                case PSI_T_TILDE:
                        return 0;
+               case PSI_T_CAST:
+                       return 0;
+               case PSI_T_ASTERISK:
+                       return -1;
+               case PSI_T_SLASH:
+                       return -1;
+               case PSI_T_MODULO:
+                       return -1;
+               case PSI_T_PLUS:
+                       return -1;
+               case PSI_T_MINUS:
+                       return -1;
+               case PSI_T_LSHIFT:
+                       return -1;
+               case PSI_T_RSHIFT:
+                       return -1;
+               case PSI_T_LCHEVR:
+                       return -1;
+               case PSI_T_CMP_LE:
+                       return -1;
+               case PSI_T_RCHEVR:
+                       return -1;
+               case PSI_T_CMP_GE:
+                       return -1;
+               case PSI_T_AMPERSAND:
+                       return -1;
+               case PSI_T_CMP_EQ:
+                       return -1;
+               case PSI_T_CMP_NE:
+                       return -1;
+               case PSI_T_CARET:
+                       return -1;
+               case PSI_T_PIPE:
+                       return -1;
+               case PSI_T_AND:
+                       return -1;
+               case PSI_T_OR:
+                       return -1;
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+
+       case PSI_T_CAST:
+               switch (op2) {
+               case PSI_T_NOT:
+                       return 0;
+               case PSI_T_TILDE:
+                       return 0;
+               case PSI_T_CAST:
+                       return 0;
                case PSI_T_ASTERISK:
                        return -1;
                case PSI_T_SLASH:
@@ -145,6 +199,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 0;
                case PSI_T_SLASH:
@@ -193,6 +249,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 0;
                case PSI_T_SLASH:
@@ -241,6 +299,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 0;
                case PSI_T_SLASH:
@@ -289,6 +349,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -337,6 +399,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -385,6 +449,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -433,6 +499,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -481,6 +549,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -529,6 +599,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -577,6 +649,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -625,6 +699,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -673,6 +749,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -721,6 +799,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -769,6 +849,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -817,6 +899,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -865,6 +949,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -913,6 +999,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
@@ -961,6 +1049,8 @@ static inline int psi_calc_oper(token_t op1, token_t op2)
                        return 1;
                case PSI_T_TILDE:
                        return 1;
+               case PSI_T_CAST:
+                       return 1;
                case PSI_T_ASTERISK:
                        return 1;
                case PSI_T_SLASH:
index 199f533..161534e 100644 (file)
@@ -240,6 +240,7 @@ void psi_context_build(struct psi_context *C, const char *paths)
                        for (i = 0; i < n; ++i) {
                                char psi[MAXPATHLEN];
                                struct psi_parser P;
+                               struct psi_parser_input *I;
 
                                if (MAXPATHLEN <= slprintf(psi, MAXPATHLEN, "%s/%s", ptr, entries[i]->d_name)) {
                                        C->error(PSI_DATA(C), NULL, PSI_WARNING, "Path to PSI file too long: %s/%s",
@@ -250,15 +251,15 @@ void psi_context_build(struct psi_context *C, const char *paths)
                                                psi, strerror(errno));
                                        continue;
                                }
-                               if (!psi_parser_open_file(&P, psi)) {
+                               if (!(I = psi_parser_open_file(&P, psi, true))) {
                                        C->error(PSI_DATA(C), NULL, PSI_WARNING, "Failed to open PSI file (%s): %s",
                                                psi, strerror(errno));
                                        continue;
                                }
-
-                               psi_parser_parse(&P);
+                               psi_parser_parse(&P, I);
                                psi_context_add_data(C, PSI_DATA(&P));
                                psi_parser_dtor(&P);
+                               free(I);
                        }
                }
 
index 8fcd5cf..0c64246 100644 (file)
--- a/src/cpp.c
+++ b/src/cpp.c
 #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)
+#define PSI_CPP_SEARCH
+#define PSI_CPP_PREDEF
+#include "php_psi_cpp.h"
+
+static void free_cpp_def(zval *p)
 {
-       if (psi_cpp_level_skipped(cpp)) {
-               cpp->skip = 0;
+       if (Z_TYPE_P(p) == IS_PTR) {
+               psi_cpp_macro_decl_free((void *) &Z_PTR_P(p));
        }
 }
-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)
+
+struct psi_cpp *psi_cpp_init(struct psi_parser *P)
 {
-       assert(!psi_cpp_level_masked(cpp));
-       cpp->seen |= (1 << cpp->level);
+       struct psi_cpp *cpp = calloc(1, sizeof(*cpp));
+
+       cpp->parser = P;
+       ALLOC_HASHTABLE(cpp->defs);
+       zend_hash_init(cpp->defs, 0, NULL, free_cpp_def, 1);
+
+       return cpp;
 }
-static inline void psi_cpp_level_unmask(struct psi_cpp_data *cpp)
+
+bool psi_cpp_load_defaults(struct psi_cpp *cpp)
 {
-       cpp->seen &= ~(1 << cpp->level);
+       struct psi_parser_input *predef;
+
+       if ((predef = psi_parser_open_string(cpp->parser, psi_cpp_predef, sizeof(psi_cpp_predef) - 1))) {
+               bool parsed = psi_parser_parse(cpp->parser, predef);
+               free(predef);
+               return parsed;
+       }
+
+       return false;
 }
 
-static void psi_cpp_eval(struct psi_data *D, struct psi_cpp_data *cpp)
+static int dump_def(zval *p)
 {
-       assert(cpp->exp);
+       struct psi_cpp_macro_decl *decl = Z_PTR_P(p);
 
-       PSI_DEBUG_PRINT(D, "PSI: CPP EVAL < %s (level=%u, skip=%u)\n",
-                       cpp->exp->token->text, cpp->level, cpp->skip);
+       if (decl) {
+               dprintf(2, "#define ");
+               psi_cpp_macro_decl_dump(2, decl);
+               dprintf(2, "\n");
+       }
+       return ZEND_HASH_APPLY_KEEP;
+}
 
-#if PSI_CPP_DEBUG
-       psi_cpp_exp_dump(2, cpp->exp);
-#endif
+void psi_cpp_free(struct psi_cpp **cpp_ptr)
+{
+       if (*cpp_ptr) {
+               struct psi_cpp *cpp = *cpp_ptr;
 
-       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;
+               *cpp_ptr = NULL;
+               if (cpp->parser->flags & PSI_DEBUG) {
+                       fprintf(stderr, "PSI: CPP decls:\n");
+                       zend_hash_apply(cpp->defs, dump_def);
                }
-               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;
+               zend_hash_destroy(cpp->defs);
+               FREE_HASHTABLE(cpp->defs);
+               free(cpp);
        }
-
-       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)
+static bool psi_cpp_stage1(struct psi_cpp *cpp)
 {
        bool name = false, define = false, hash = false, eol = true, esc = false, ws = false;
 
@@ -272,8 +178,10 @@ static bool psi_cpp_stage1(struct psi_parser *P, struct psi_cpp_data *cpp)
        return true;
 }
 
-static bool psi_cpp_stage2(struct psi_parser *P, struct psi_cpp_data *cpp)
+static bool psi_cpp_stage2(struct psi_cpp *cpp)
 {
+       struct psi_plist *parser_tokens = psi_plist_init((psi_plist_dtor) psi_token_free);
+
        do {
                bool is_eol = true, do_cpp = false, do_expansion = true, skip_paren = false, skip_all = false;
 
@@ -322,6 +230,7 @@ static bool psi_cpp_stage2(struct psi_parser *P, struct psi_cpp_data *cpp)
                                                do_expansion = false;
                                                break;
                                        case PSI_T_LPAREN:
+
                                                if (!skip_all) {
                                                        if (skip_paren) {
                                                                skip_paren = false;
@@ -338,7 +247,7 @@ static bool psi_cpp_stage2(struct psi_parser *P, struct psi_cpp_data *cpp)
                                        default:
                                                do_expansion = !skip_all;
 #if PSI_CPP_DEBUG
-                                               fprintf(stderr, "PSI CPP do_expansion=%s, <- !skip_all\n", do_expansion?"true":"false");
+                                               fprintf(stderr, "PSI: CPP do_expansion=%s, <- !skip_all\n", do_expansion?"true":"false");
 #endif
                                        }
                                }
@@ -368,25 +277,21 @@ static bool psi_cpp_stage2(struct psi_parser *P, struct psi_cpp_data *cpp)
                        }
 
                        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);
+                               parser_tokens = psi_plist_add(parser_tokens, &current);
                                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);
+                                       size_t processed = 0;
+
+                                       if (!psi_parser_process(cpp->parser, parser_tokens, &processed)) {
+                                               psi_plist_free(parser_tokens);
+                                               return false;
+                                       }
+                                       psi_plist_clean(parser_tokens);
+                                       do_cpp = false;
                                }
 
-#if PSI_CPP_DEBUG
+#if PSI_CPP_DEBUG > 1
                                psi_cpp_tokiter_dump(2, cpp);
 #endif
 
@@ -397,28 +302,32 @@ static bool psi_cpp_stage2(struct psi_parser *P, struct psi_cpp_data *cpp)
                }
        } while (cpp->expanded);
 
+       psi_plist_free(parser_tokens);
+
        return true;
 }
 
-bool psi_cpp_preprocess(struct psi_parser *P, struct psi_cpp_data *cpp)
+bool psi_cpp_process(struct psi_cpp *cpp, struct psi_plist **tokens)
 {
-       if (!psi_cpp_stage1(P, cpp)) {
-               return false;
-       }
+       struct psi_cpp temp = *cpp;
 
-       if (!psi_cpp_stage2(P, cpp)) {
-               return false;
+       temp.tokens = *tokens;
+
+       if (psi_cpp_stage1(&temp) && psi_cpp_stage2(&temp)) {
+               *tokens = temp.tokens;
+               return true;
        }
 
-       return true;
+       *tokens = temp.tokens;
+       return false;
 }
 
-bool psi_cpp_defined(struct psi_cpp_data *cpp, struct psi_token *tok)
+bool psi_cpp_defined(struct psi_cpp *cpp, struct psi_token *tok)
 {
        bool defined;
 
        if (tok->type == PSI_T_NAME) {
-               defined = zend_hash_str_exists(&cpp->defs, tok->text, tok->size);
+               defined = zend_hash_str_exists(cpp->defs, tok->text, tok->size);
        } else {
                defined = false;
        }
@@ -431,23 +340,97 @@ bool psi_cpp_defined(struct psi_cpp_data *cpp, struct psi_token *tok)
        return defined;
 }
 
-void psi_cpp_define(struct psi_cpp_data *cpp, struct psi_cpp_macro_decl *decl)
+void psi_cpp_define(struct psi_cpp *cpp, struct psi_cpp_macro_decl *decl)
 {
-       zend_hash_str_add_ptr(&cpp->defs, decl->token->text, decl->token->size, decl);
+       struct psi_cpp_macro_decl *old = zend_hash_str_find_ptr(cpp->defs, decl->token->text, decl->token->size);
+
+       if (old && !psi_cpp_macro_decl_equal(old, decl)) {
+               cpp->parser->error(PSI_DATA(cpp->parser), decl->token, PSI_WARNING,
+                               "'%s' redefined", decl->token->text);
+               cpp->parser->error(PSI_DATA(cpp->parser), old->token, PSI_WARNING,
+                               "'%s' previously defined", old->token->text);
+       }
+       zend_hash_str_update_ptr(cpp->defs, decl->token->text, decl->token->size, decl);
 }
 
-bool psi_cpp_undef(struct psi_cpp_data *cpp, struct psi_token *tok)
+bool psi_cpp_undef(struct psi_cpp *cpp, struct psi_token *tok)
 {
-       return SUCCESS == zend_hash_str_del(&cpp->defs, tok->text, tok->size);
+       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)
+bool psi_cpp_if(struct psi_cpp *cpp, struct psi_cpp_exp *exp)
 {
-       if (!psi_num_exp_validate(D, exp->data.num, NULL, NULL, NULL, NULL, NULL)) {
+       if (!psi_num_exp_validate(PSI_DATA(cpp->parser), exp->data.num, NULL, NULL, NULL, NULL, NULL)) {
                return false;
        }
-       if (!psi_long_num_exp(exp->data.num, NULL, defs)) {
+       if (!psi_long_num_exp(exp->data.num, NULL, cpp->defs)) {
                return false;
        }
        return true;
 }
+
+static inline bool try_include(struct psi_cpp *cpp, const char *path, bool *parsed)
+{
+       struct psi_parser_input *include;
+
+       PSI_DEBUG_PRINT(cpp->parser, "PSI: CPP include trying %s\n", path);
+
+       include = psi_parser_open_file(cpp->parser, path, false);
+       if (include) {
+               struct psi_plist *tokens;
+
+               PSI_DEBUG_PRINT(cpp->parser, "PSI: CPP include scanning %s\n", path);
+
+               tokens = psi_parser_scan(cpp->parser, include);
+               if (tokens) {
+                       if ((*parsed = psi_cpp_process(cpp, &tokens))) {
+                               psi_cpp_tokiter_ins_range(cpp, psi_cpp_tokiter_index(cpp),
+                                               psi_plist_count(tokens), psi_plist_eles(tokens));
+                       }
+                       psi_plist_free(tokens);
+               }
+               free(include);
+               return true;
+       }
+       return false;
+}
+
+bool psi_cpp_include(struct psi_cpp *cpp, const char *file, unsigned flags)
+{
+       char path[PATH_MAX];
+       bool parsed = false;
+       int f_len = strlen(file) - 2;
+
+       if (file[1] == '/' && PATH_MAX > snprintf(path, PATH_MAX, "%.*s", f_len, file + 1)) {
+               return try_include(cpp, path, &parsed) && parsed;
+       } else {
+               const char *sep;
+
+               if ((flags & PSI_CPP_INCLUDE_NEXT) && cpp->search) {
+                       if ((sep = strchr(cpp->search, ':'))) {
+                               cpp->search = sep + 1;
+                       } else {
+                               cpp->search += strlen(cpp->search); /* point to end of string */
+                       }
+               }
+               if (!(flags & PSI_CPP_INCLUDE_NEXT) || !cpp->search) {
+                       cpp->search = &psi_cpp_search[0];
+               }
+
+               do {
+                       int d_len;
+
+                       sep = strchr(cpp->search, ':');
+                       d_len = sep ? sep - cpp->search : strlen(cpp->search);
+
+                       if (PATH_MAX > snprintf(path, PATH_MAX, "%.*s/%.*s", d_len, cpp->search, f_len, file + 1)) {
+                               if (try_include(cpp, path, &parsed)) {
+                                       break;
+                               }
+                       }
+                       cpp->search = sep + 1;
+               } while (sep);
+       }
+
+       return parsed;
+}
index 1a8fc2c..b778b14 100644 (file)
--- a/src/cpp.h
+++ b/src/cpp.h
 # define PSI_CPP_DEBUG 0
 #endif
 
-struct psi_cpp_data {
-       HashTable defs;
+struct psi_cpp_tokiter {
+};
+
+struct psi_cpp {
+       HashTable *defs;
+       struct psi_parser *parser;
+       struct psi_plist *tokens;
+       const char *search;
+       size_t index;
        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);
+struct psi_cpp *psi_cpp_init(struct psi_parser *parser);
+bool psi_cpp_load_defaults(struct psi_cpp *cpp);
+bool psi_cpp_process(struct psi_cpp *cpp, struct psi_plist **tokens);
+void psi_cpp_free(struct psi_cpp **cpp_ptr);
+
+bool psi_cpp_if(struct psi_cpp *cpp, struct psi_cpp_exp *exp);
+bool psi_cpp_defined(struct psi_cpp *cpp, struct psi_token *tok);
+void psi_cpp_define(struct psi_cpp *cpp, struct psi_cpp_macro_decl *decl);
+bool psi_cpp_undef(struct psi_cpp *cpp, struct psi_token *tok);
+
+#define PSI_CPP_INCLUDE 0x0
+#define PSI_CPP_INCLUDE_NEXT 0x1
+#define PSI_CPP_INCLUDE_ONCE 0x2
+
+bool psi_cpp_include(struct psi_cpp *cpp, const char *file, unsigned flags);
 
-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,
+void psi_cpp_tokiter_reset(struct psi_cpp *cpp);
+bool psi_cpp_tokiter_seek(struct psi_cpp *cpp, size_t index);
+void psi_cpp_tokiter_dump(int fd, struct psi_cpp *cpp);
+struct psi_token *psi_cpp_tokiter_current(struct psi_cpp *cpp);
+size_t psi_cpp_tokiter_index(struct psi_cpp *cpp);
+void psi_cpp_tokiter_next(struct psi_cpp *cpp);
+void psi_cpp_tokiter_prev(struct psi_cpp *cpp);
+bool psi_cpp_tokiter_valid(struct psi_cpp *cpp);
+bool psi_cpp_tokiter_del_cur(struct psi_cpp *cpp, bool free_token);
+bool psi_cpp_tokiter_del_range(struct psi_cpp *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,
+bool psi_cpp_tokiter_ins_cur(struct psi_cpp *cpp, struct psi_token *tok);
+bool psi_cpp_tokiter_ins_range(struct psi_cpp *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);
+bool psi_cpp_tokiter_defined(struct psi_cpp *cpp);
+bool psi_cpp_tokiter_expand(struct psi_cpp *cpp);
 
 #endif
index 7aa938e..d980e61 100644 (file)
@@ -29,7 +29,7 @@
 #include "parser.h"
 
 
-void psi_cpp_tokiter_dump(int fd, struct psi_cpp_data *cpp)
+void psi_cpp_tokiter_dump(int fd, struct psi_cpp *cpp)
 {
        size_t i;
        struct psi_token *T;
@@ -40,17 +40,19 @@ void psi_cpp_tokiter_dump(int fd, struct psi_cpp_data *cpp)
        }
 }
 
-void psi_cpp_tokiter_reset(struct psi_cpp_data *cpp)
+void psi_cpp_tokiter_reset(struct psi_cpp *cpp)
 {
 #if PSI_CPP_DEBUG
        fprintf(stderr, "PSI: CPP reset (%zu tokens)\n", psi_plist_count(cpp->tokens));
+#      if PSI_CPP_DEBUG > 1
        psi_cpp_tokiter_dump(2, cpp);
+#      endif
 #endif
        cpp->index = 0;
        cpp->expanded = 0;
 }
 
-bool psi_cpp_tokiter_seek(struct psi_cpp_data *cpp, size_t index)
+bool psi_cpp_tokiter_seek(struct psi_cpp *cpp, size_t index)
 {
        if (index < psi_plist_count(cpp->tokens)) {
                cpp->index = index;
@@ -59,7 +61,7 @@ bool psi_cpp_tokiter_seek(struct psi_cpp_data *cpp, size_t index)
        return false;
 }
 
-struct psi_token *psi_cpp_tokiter_current(struct psi_cpp_data *cpp)
+struct psi_token *psi_cpp_tokiter_current(struct psi_cpp *cpp)
 {
        struct psi_token *current = NULL;
        bool found = psi_plist_get(cpp->tokens, cpp->index, &current);
@@ -69,12 +71,12 @@ struct psi_token *psi_cpp_tokiter_current(struct psi_cpp_data *cpp)
        return current;
 }
 
-size_t psi_cpp_tokiter_index(struct psi_cpp_data *cpp)
+size_t psi_cpp_tokiter_index(struct psi_cpp *cpp)
 {
        return cpp->index;
 }
 
-void psi_cpp_tokiter_next(struct psi_cpp_data *cpp)
+void psi_cpp_tokiter_next(struct psi_cpp *cpp)
 {
 #if 0 && PSI_CPP_DEBUG
        fprintf(stderr, "PSI: CPP next -> index=%zu -> index=%zu\n", cpp->index, cpp->index+1);
@@ -82,7 +84,7 @@ void psi_cpp_tokiter_next(struct psi_cpp_data *cpp)
        ++cpp->index;
 }
 
-void psi_cpp_tokiter_prev(struct psi_cpp_data *cpp)
+void psi_cpp_tokiter_prev(struct psi_cpp *cpp)
 {
 #if 0 && PSI_CPP_DEBUG
        fprintf(stderr, "PSI: CPP prev -> index=%zu -> index=%zu\n", cpp->index, cpp->index-1);
@@ -92,7 +94,7 @@ void psi_cpp_tokiter_prev(struct psi_cpp_data *cpp)
        }
 }
 
-bool psi_cpp_tokiter_valid(struct psi_cpp_data *cpp)
+bool psi_cpp_tokiter_valid(struct psi_cpp *cpp)
 {
 #if 0 && PSI_CPP_DEBUG
        fprintf(stderr, "PSI: CPP valid -> index=%zu -> %d\n", cpp->index, cpp->index < psi_plist_count(cpp->tokens));
@@ -100,14 +102,15 @@ bool psi_cpp_tokiter_valid(struct psi_cpp_data *cpp)
        return cpp->index < psi_plist_count(cpp->tokens);
 }
 
-bool psi_cpp_tokiter_del_cur(struct psi_cpp_data *cpp, bool free_token)
+bool psi_cpp_tokiter_del_cur(struct psi_cpp *cpp, bool free_token)
 {
        struct psi_token *cur = NULL;
        bool deleted = psi_plist_del(cpp->tokens, cpp->index, &cur);
+       size_t count;
 
 #if PSI_CPP_DEBUG
-       fprintf(stderr, "PSI: CPP del_cur -> index=%zu, del=%d, free=%d ",
-                       cpp->index, (int) deleted, (int) free_token);
+       fprintf(stderr, "PSI: CPP del_cur -> index=%zu, del=%d, free=%d, count=%zu ",
+                       cpp->index, (int) deleted, (int) free_token, psi_plist_count(cpp->tokens));
        if (cur) {
                psi_token_dump(2, cur);
        } else {
@@ -117,13 +120,18 @@ bool psi_cpp_tokiter_del_cur(struct psi_cpp_data *cpp, bool free_token)
        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);
+       count = psi_plist_count(cpp->tokens);
+       if (deleted && cpp->index >= count) {
+               if (count > 0) {
+                       cpp->index = count - 1;
+               } else {
+                       cpp->index = 0;
+               }
        }
        return deleted;
 }
 
-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_del_range(struct psi_cpp *cpp, size_t offset, size_t num_eles, bool free_tokens)
 {
        struct psi_token **ptr;
        bool deleted;
@@ -135,7 +143,8 @@ bool psi_cpp_tokiter_del_range(struct psi_cpp_data *cpp, size_t offset, size_t n
        }
 
 #if PSI_CPP_DEBUG
-       fprintf(stderr, "PSI: CPP del_range -> index=%zu, offset=%zu, num_eles=%zu\n", cpp->index, offset, num_eles);
+       fprintf(stderr, "PSI: CPP del_range -> index=%zu, offset=%zu, num_eles=%zu, count=%zu\n",
+                       cpp->index, offset, num_eles, psi_plist_count(cpp->tokens));
 #endif
 
        deleted = psi_plist_del_r(cpp->tokens, offset, num_eles, (void *) ptr);
@@ -156,7 +165,7 @@ bool psi_cpp_tokiter_del_range(struct psi_cpp_data *cpp, size_t offset, size_t n
        return deleted;
 }
 
-bool psi_cpp_tokiter_ins_cur(struct psi_cpp_data *cpp, struct psi_token *tok)
+bool psi_cpp_tokiter_ins_cur(struct psi_cpp *cpp, struct psi_token *tok)
 {
        struct psi_plist *tokens = psi_plist_ins(cpp->tokens, cpp->index, &tok);
 
@@ -172,14 +181,20 @@ bool psi_cpp_tokiter_ins_cur(struct psi_cpp_data *cpp, struct psi_token *tok)
        return true;
 }
 
-bool psi_cpp_tokiter_ins_range(struct psi_cpp_data *cpp, size_t offset,
+bool psi_cpp_tokiter_ins_range(struct psi_cpp *cpp, size_t offset,
                size_t num_eles, void **eles)
 {
-       struct psi_plist *tokens = psi_plist_ins_r(cpp->tokens, offset,
-                       num_eles, eles);
+       struct psi_plist *tokens;
+
+       if (!num_eles) {
+               return true;
+       }
+
+       tokens = psi_plist_ins_r(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);
+       fprintf(stderr, "PSI: CPP ins_range -> index=%zu, offset=%zu, num_eles=%zu, count=%zu\n",
+                       cpp->index, offset, num_eles, psi_plist_count(tokens));
 #endif
 
        if (!tokens) {
@@ -189,7 +204,7 @@ bool psi_cpp_tokiter_ins_range(struct psi_cpp_data *cpp, size_t offset,
        return true;
 }
 
-bool psi_cpp_tokiter_defined(struct psi_cpp_data *cpp)
+bool psi_cpp_tokiter_defined(struct psi_cpp *cpp)
 {
        if (psi_cpp_tokiter_valid(cpp)) {
                struct psi_token *current = psi_cpp_tokiter_current(cpp);
@@ -200,7 +215,7 @@ bool psi_cpp_tokiter_defined(struct psi_cpp_data *cpp)
        return false;
 }
 
-void psi_cpp_tokiter_expand_tokens(struct psi_cpp_data *cpp, struct psi_plist *tokens)
+void psi_cpp_tokiter_expand_tokens(struct psi_cpp *cpp, struct psi_plist *tokens)
 {
        if (tokens && psi_plist_count(tokens)) {
                size_t i = 0, n = 0;
@@ -267,11 +282,11 @@ static void psi_cpp_tokiter_free_call_tokens(struct psi_plist **arg_tokens_list,
 }
 
 static struct psi_plist **psi_cpp_tokiter_read_call_tokens(
-               struct psi_cpp_data *cpp, size_t arg_count)
+               struct psi_cpp *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_plist *free_tokens = psi_plist_init((psi_plist_dtor) psi_token_free);
        struct psi_token *tok;
 
        arg_tokens[0] = psi_plist_init(NULL);
@@ -339,7 +354,7 @@ fail:
        return NULL;
 }
 
-static void psi_cpp_tokiter_expand_call_tokens(struct psi_cpp_data *cpp,
+static void psi_cpp_tokiter_expand_call_tokens(struct psi_cpp *cpp,
                struct psi_cpp_macro_decl *macro, struct psi_plist **arg_tokens_list)
 {
        size_t i;
@@ -374,7 +389,7 @@ static void psi_cpp_tokiter_expand_call_tokens(struct psi_cpp_data *cpp,
        psi_plist_free(tokens);
 }
 
-static bool psi_cpp_tokiter_expand_call(struct psi_cpp_data *cpp,
+static bool psi_cpp_tokiter_expand_call(struct psi_cpp *cpp,
                struct psi_cpp_macro_decl *macro)
 {
        /* function-like macro
@@ -405,14 +420,14 @@ static bool psi_cpp_tokiter_expand_call(struct psi_cpp_data *cpp,
        return true;
 }
 
-bool psi_cpp_tokiter_expand(struct psi_cpp_data *cpp)
+bool psi_cpp_tokiter_expand(struct psi_cpp *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);
+                                       cpp->defs, current->text, current->size);
 
                        /* don't expand itself */
                        if (macro && macro->token != current) {
index b36eb5f..e7ffc67 100644 (file)
@@ -459,12 +459,14 @@ impl_val *psi_let_strlen(impl_val *tmp, struct psi_decl_type *spec, token_t impl
        return tmp;
 }
 
+#if 0
 static impl_val *iterate(impl_val *val, size_t size, unsigned i, impl_val *tmp)
 {
        memset(tmp, 0, sizeof(*tmp));
        memcpy(tmp, ((char *) val) + size * i, size);
        return tmp;
 }
+#endif
 
 /*
  * set $ivar = to_array(dvar,
index 1db2adf..778f396 100644 (file)
@@ -127,10 +127,17 @@ ZEND_END_ARG_INFO();
 static PHP_FUNCTION(psi_validate)
 {
        zend_string *file;
+       struct psi_parser_input *I;
        struct psi_parser P;
        struct psi_data D = {0};
        zend_long flags = 0;
 
+#if PHP_DEBUG
+       if (psi_check_env("PSI_DEBUG")) {
+               flags |= PSI_DEBUG;
+       }
+#endif
+
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &file, &flags)) {
                return;
        }
@@ -138,17 +145,17 @@ static PHP_FUNCTION(psi_validate)
        if (!psi_parser_init(&P, psi_error_wrapper, flags)) {
                RETURN_FALSE;
        }
-       if (!psi_parser_open_file(&P, file->val)) {
+       if (!(I = psi_parser_open_file(&P, file->val, true))) {
                psi_parser_dtor(&P);
                RETURN_FALSE;
        }
 
-       psi_parser_parse(&P);
+       psi_parser_parse(&P, I);
        psi_data_ctor(&D, P.error, P.flags);
        RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors);
        psi_data_dtor(&D);
-
        psi_parser_dtor(&P);
+       free(I);
 }
 
 ZEND_BEGIN_ARG_INFO_EX(ai_psi_validate_string, 0, 0, 1)
@@ -157,10 +164,17 @@ ZEND_END_ARG_INFO();
 static PHP_FUNCTION(psi_validate_string)
 {
        zend_string *string;
+       struct psi_parser_input *I;
        struct psi_parser P;
        struct psi_data D = {0};
        zend_long flags = 0;
 
+#if PHP_DEBUG
+       if (psi_check_env("PSI_DEBUG")) {
+               flags |= PSI_DEBUG;
+       }
+#endif
+
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &string, &flags)) {
                return;
        }
@@ -168,17 +182,17 @@ static PHP_FUNCTION(psi_validate_string)
        if (!psi_parser_init(&P, psi_error_wrapper, flags)) {
                RETURN_FALSE;
        }
-       if (!psi_parser_open_string(&P, string->val, string->len)) {
+       if (!(I = psi_parser_open_string(&P, string->val, string->len))) {
                psi_parser_dtor(&P);
                RETURN_FALSE;
        }
 
-       psi_parser_parse(&P);
+       psi_parser_parse(&P, I);
        psi_data_ctor(&D, P.error, P.flags);
        RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors);
        psi_data_dtor(&D);
-
        psi_parser_dtor(&P);
+       free(I);
 }
 
 static PHP_MINIT_FUNCTION(psi)
index 2b6c11e..12ea648 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.16 on Tue Mar  7 09:49:40 2017 */
+/* Generated by re2c 0.16 on Fri Mar 24 12:21:07 2017 */
 #line 1 "src/parser.re"
 /*******************************************************************************
  Copyright (c) 2016, Michael Wallner <mike@php.net>.
 
 #include "parser.h"
 
-#define YYMAXFILL 12
+#define YYMAXFILL 13
 #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)
 {
@@ -57,104 +46,85 @@ struct psi_parser *psi_parser_init(struct psi_parser *P, psi_error_cb error, uns
 
        psi_data_ctor_with_dtors(PSI_DATA(P), error, flags);
 
-       P->col = 1;
-       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);
+       P->preproc = psi_cpp_init(P);
 
-       if (flags & PSI_DEBUG) {
-               psi_parser_proc_trace(stderr, "PSI> ");
-       }
+       psi_cpp_load_defaults(P->preproc);
 
        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)
+struct psi_parser_input *psi_parser_open_file(struct psi_parser *P, const char *filename, bool report_errors)
 {
        struct stat sb;
        FILE *fp;
-       char *fb;
+       struct psi_parser_input *fb;
 
        if (stat(filename, &sb)) {
-               P->error(PSI_DATA(P), NULL, PSI_WARNING,
-                               "Could not stat '%s': %s",
-                               filename, strerror(errno));
-               return false;
+               if (report_errors) {
+                       P->error(PSI_DATA(P), NULL, PSI_WARNING,
+                                       "Could not stat '%s': %s",
+                                       filename, strerror(errno));
+               }
+               return NULL;
        }
 
-       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 (!(fb = malloc(sizeof(*fb) + strlen(filename) + 1 + sb.st_size + YYMAXFILL))) {
+               if (report_errors) {
+                       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 NULL;
        }
 
        if (!(fp = fopen(filename, "r"))) {
                free(fb);
-               P->error(PSI_DATA(P), NULL, PSI_WARNING,
-                               "Could not open '%s' for reading: %s",
-                               filename, strerror(errno));
-               return false;
+               if (report_errors) {
+                       P->error(PSI_DATA(P), NULL, PSI_WARNING,
+                                       "Could not open '%s' for reading: %s",
+                                       filename, strerror(errno));
+               }
+               return NULL;
        }
 
-       if (sb.st_size != fread(fb, 1, sb.st_size, fp)) {
+       if (sb.st_size != fread(fb->buffer, 1, sb.st_size, fp)) {
                free(fb);
                fclose(fp);
-               P->error(PSI_DATA(P), NULL, PSI_WARNING,
-                               "Could not read %zu bytes from '%s': %s",
-                               sb.st_size + YYMAXFILL, filename, strerror(errno));
-               return false;
-       }
-       memset(fb + sb.st_size, 0, YYMAXFILL);
-
-       if (P->input.buffer) {
-               free(P->input.buffer);
+               if (report_errors) {
+                       P->error(PSI_DATA(P), NULL, PSI_WARNING,
+                                       "Could not read %zu bytes from '%s': %s",
+                                       sb.st_size + YYMAXFILL, filename, strerror(errno));
+               }
+               return NULL;
        }
-       P->input.buffer = fb;
-       P->input.length = sb.st_size;
 
-       P->file.fn = strdup(filename);
+       memset(fb->buffer + sb.st_size, 0, YYMAXFILL);
+       fb->length = sb.st_size;
+       fb->file = &fb->buffer[sb.st_size + YYMAXFILL];
+       memcpy(fb->file, filename, strlen(filename) + 1);
 
-       psi_parser_reset(P);
-
-       return true;
+       return fb;
 }
 
-bool psi_parser_open_string(struct psi_parser *P, const char *string, size_t length)
+struct psi_parser_input *psi_parser_open_string(struct psi_parser *P, const char *string, size_t length)
 {
-       char *sb;
+       struct psi_parser_input *sb;
 
-       if (!(sb = malloc(length + YYMAXFILL))) {
+       if (!(sb = malloc(sizeof(*sb) + sizeof("<stdin>") + 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);
+               return NULL;
        }
-       P->input.buffer = sb;
-       P->input.length = length;
 
-       P->file.fn = strdup("<input>");
+       memcpy(sb->buffer, string, length);
+       memset(sb->buffer + length, 0, YYMAXFILL);
 
-       psi_parser_reset(P);
+       sb->length = length;
+       sb->file = &sb->buffer[length + YYMAXFILL];
+       memcpy(sb->file, "<stdin>", sizeof("<stdin>"));
 
-       return true;
+       return sb;
 }
 
 #if 0
@@ -213,42 +183,58 @@ static void psi_parser_register_constants(struct psi_parser *P)
 }
 #endif
 
-void psi_parser_parse(struct psi_parser *P)
+struct psi_plist *psi_parser_preprocess(struct psi_parser *P, struct psi_plist *tokens)
 {
-       size_t i = 0;
-       struct psi_token *T;
-
-       P->cpp.tokens = psi_parser_scan(P);
+       if (psi_cpp_process(P->preproc, &tokens)) {
+               return tokens;
+       }
+       return NULL;
+}
 
-       psi_cpp_preprocess(P, &P->cpp);
+bool psi_parser_process(struct psi_parser *P, struct psi_plist *tokens, size_t *processed)
+{
+       if (psi_plist_count(tokens)) {
+               int rc;
 
-       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_parser_proc_parse(P->proc, T->type, T, P);
+               if (P->flags & PSI_DEBUG) {
+                       psi_parser_proc_debug = 1;
                }
-               psi_parser_proc_parse(P->proc, 0, NULL, P);
+               rc = psi_parser_proc_parse(P, tokens, processed);
+               if (P->flags & PSI_DEBUG) {
+                       psi_parser_proc_debug = 0;
+               }
+               return rc == 0;
        }
-
-       psi_plist_free(P->cpp.tokens);
-       P->cpp.tokens = NULL;
+       return true;
 }
 
-void psi_parser_dtor(struct psi_parser *P)
+bool psi_parser_parse(struct psi_parser *P, struct psi_parser_input *I)
 {
-       psi_parser_proc_free(&P->proc);
+       struct psi_plist *scanned, *preproc;
+       size_t processed = 0;
 
-       if (P->input.buffer) {
-               free(P->input.buffer);
-               P->input.buffer = NULL;
+       if (!(scanned = psi_parser_scan(P, I))) {
+               return false;
        }
 
-       psi_data_dtor(PSI_DATA(P));
+       if (!(preproc = psi_parser_preprocess(P, scanned))) {
+               psi_plist_free(scanned);
+               return false;
+       }
+
+       if (!psi_parser_process(P, preproc, &processed)) {
+               psi_plist_free(preproc);
+               return false;
+       }
+
+       psi_plist_free(preproc);
+       return true;
+}
 
-       zend_hash_destroy(&P->cpp.defs);
+void psi_parser_dtor(struct psi_parser *P)
+{
+       psi_cpp_free(&P->preproc);
+       psi_data_dtor(PSI_DATA(P));
 
        memset(P, 0, sizeof(*P));
 }
@@ -263,43 +249,73 @@ void psi_parser_free(struct psi_parser **P)
 }
 
 #define NEWLINE() \
-       P->col = 1; \
-       ++P->line
+       eol = cur; \
+       ++I->lines
 
 #define NEWTOKEN(t) \
-       P->num = t; \
-       token = psi_token_alloc(P); \
+       token = psi_token_init(t, tok, cur - tok, tok - eol + 1, I->lines, I->file); \
        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
+       }
 
 
-struct psi_plist *psi_parser_scan(struct psi_parser *P)
+struct psi_plist *psi_parser_scan(struct psi_parser *P, struct psi_parser_input *I)
 {
        struct psi_plist *tokens;
        struct psi_token *token;
+       const char *tok, *cur, *lim, *mrk, *eol;
 
-       if (!P->cur) {
-               return NULL;
-       }
-
-       tokens = psi_plist_init(NULL);
+       tok = mrk = eol = cur = I->buffer;
+       lim = I->buffer + I->length;
+       I->lines = 1;
+       tokens = psi_plist_init((void (*)(void *)) psi_token_free);
 
        start: ;
-               P->tok = P->cur;
+               tok = cur;
 
                
-#line 297 "src/parser.c"
+#line 280 "src/parser.c"
                {
                        unsigned char yych;
                        unsigned int yyaccept = 0;
-                       if ((P->lim - P->cur) < 12) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
-                       switch (yych) {
+                       if ((lim - cur) < 13) if (cur >= lim) goto done;;
+                       yych = *cur;
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\v':
+                       case '\f':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case '?':
+                       case '@':
+                       case '`':
+                       case 0x7F:      goto yy2;
                        case '\t':
                        case ' ':       goto yy4;
                        case '\n':
@@ -310,15 +326,16 @@ struct psi_plist *psi_parser_scan(struct psi_parser *P)
                        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 '\'':      goto yy19;
+                       case '(':       goto yy20;
+                       case ')':       goto yy22;
+                       case '*':       goto yy24;
+                       case '+':       goto yy26;
+                       case ',':       goto yy28;
+                       case '-':       goto yy30;
+                       case '.':       goto yy32;
+                       case '/':       goto yy34;
+                       case '0':       goto yy36;
                        case '1':
                        case '2':
                        case '3':
@@ -327,124 +344,365 @@ struct psi_plist *psi_parser_scan(struct psi_parser *P)
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy34;
-                       case ':':       goto yy37;
-                       case ';':       goto yy39;
-                       case '<':       goto yy41;
-                       case '=':       goto yy43;
-                       case '>':       goto yy45;
+                       case '9':       goto yy38;
+                       case ':':       goto yy40;
+                       case ';':       goto yy42;
+                       case '<':       goto yy44;
+                       case '=':       goto yy46;
+                       case '>':       goto yy48;
                        case 'A':
-                       case 'a':       goto yy47;
+                       case 'a':       goto yy50;
                        case 'B':
-                       case 'b':       goto yy49;
+                       case 'b':       goto yy52;
                        case 'C':
-                       case 'c':       goto yy50;
+                       case 'c':       goto yy53;
                        case 'D':
-                       case 'd':       goto yy51;
+                       case 'd':       goto yy54;
                        case 'E':
-                       case 'e':       goto yy52;
+                       case 'e':       goto yy55;
                        case 'F':
-                       case 'f':       goto yy53;
-                       case 'G':
-                       case 'H':
-                       case 'J':
-                       case 'K':
-                       case 'Q':
-                       case 'X':
-                       case 'Y':
-                       case '_':
-                       case 'g':
-                       case 'h':
-                       case 'j':
-                       case 'k':
-                       case 'q':
-                       case 'x':
-                       case 'y':       goto yy54;
+                       case 'f':       goto yy56;
                        case 'I':
-                       case 'i':       goto yy56;
-                       case 'L':
-                       case 'l':       goto yy57;
+                       case 'i':       goto yy59;
+                       case 'L':       goto yy60;
                        case 'M':
-                       case 'm':       goto yy58;
+                       case 'm':       goto yy61;
                        case 'N':
-                       case 'n':       goto yy59;
+                       case 'n':       goto yy62;
                        case 'O':
-                       case 'o':       goto yy60;
+                       case 'o':       goto yy63;
                        case 'P':
-                       case 'p':       goto yy61;
+                       case 'p':       goto yy64;
                        case 'R':
-                       case 'r':       goto yy62;
+                       case 'r':       goto yy65;
                        case 'S':
-                       case 's':       goto yy63;
+                       case 's':       goto yy66;
                        case 'T':
-                       case 't':       goto yy64;
+                       case 't':       goto yy67;
                        case 'U':
-                       case 'u':       goto yy65;
+                       case 'u':       goto yy68;
                        case 'V':
-                       case 'v':       goto yy66;
+                       case 'v':       goto yy69;
                        case 'W':
-                       case 'w':       goto yy67;
+                       case 'w':       goto yy70;
                        case 'Z':
-                       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;
+                       case 'z':       goto yy71;
+                       case '[':       goto yy72;
+                       case '\\':      goto yy74;
+                       case ']':       goto yy76;
+                       case '^':       goto yy78;
+                       case 'l':       goto yy80;
+                       case '{':       goto yy81;
+                       case '|':       goto yy83;
+                       case '}':       goto yy85;
+                       case '~':       goto yy87;
+                       default:        goto yy57;
                        }
 yy2:
-                       ++P->cur;
+                       ++cur;
 yy3:
-#line 426 "src/parser.re"
-                       { goto error; }
-#line 405 "src/parser.c"
+#line 433 "src/parser.re"
+                       { NEWTOKEN(-2); goto error; }
+#line 407 "src/parser.c"
 yy4:
-                       ++P->cur;
-                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
+                       ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
                        switch (yych) {
                        case '\t':
                        case ' ':       goto yy4;
                        default:        goto yy6;
                        }
 yy6:
-#line 425 "src/parser.re"
+#line 432 "src/parser.re"
                        { NEWTOKEN(PSI_T_WHITESPACE); goto start; }
-#line 418 "src/parser.c"
+#line 420 "src/parser.c"
 yy7:
-                       ++P->cur;
-#line 424 "src/parser.re"
+                       ++cur;
+#line 431 "src/parser.re"
                        { NEWTOKEN(PSI_T_EOL); NEWLINE(); goto start; }
-#line 423 "src/parser.c"
+#line 425 "src/parser.c"
 yy9:
-                       ++P->cur;
-                       switch ((yych = *P->cur)) {
-                       case '=':       goto yy85;
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '=':       goto yy89;
                        default:        goto yy10;
                        }
 yy10:
-#line 333 "src/parser.re"
+#line 335 "src/parser.re"
                        { NEWTOKEN(PSI_T_NOT); goto start; }
-#line 433 "src/parser.c"
+#line 435 "src/parser.c"
 yy11:
                        yyaccept = 0;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case '"':       goto yy3;
-                       default:        goto yy87;
+                       default:        goto yy91;
                        }
 yy12:
-                       ++P->cur;
-#line 316 "src/parser.re"
+                       ++cur;
+#line 318 "src/parser.re"
                        { NEWTOKEN(PSI_T_HASH); goto start; }
-#line 445 "src/parser.c"
+#line 447 "src/parser.c"
 yy14:
-                       yych = *++P->cur;
+                       yych = *++cur;
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case '\\':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy3;
+                       default:        goto yy93;
+                       }
+yy15:
+                       ++cur;
+#line 336 "src/parser.re"
+                       { NEWTOKEN(PSI_T_MODULO); goto start; }
+#line 522 "src/parser.c"
+yy17:
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '&':       goto yy96;
+                       default:        goto yy18;
+                       }
+yy18:
+#line 337 "src/parser.re"
+                       { NEWTOKEN(PSI_T_AMPERSAND); goto start; }
+#line 532 "src/parser.c"
+yy19:
+                       yyaccept = 0;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case '\'':      goto yy3;
+                       default:        goto yy98;
+                       }
+yy20:
+                       ++cur;
+#line 319 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LPAREN); goto start; }
+#line 544 "src/parser.c"
+yy22:
+                       ++cur;
+#line 320 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RPAREN); goto start; }
+#line 549 "src/parser.c"
+yy24:
+                       ++cur;
+#line 333 "src/parser.re"
+                       { NEWTOKEN(PSI_T_ASTERISK); goto start; }
+#line 554 "src/parser.c"
+yy26:
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '.':       goto yy100;
+                       case '0':       goto yy36;
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':       goto yy38;
+                       default:        goto yy27;
+                       }
+yy27:
+#line 338 "src/parser.re"
+                       { NEWTOKEN(PSI_T_PLUS); goto start; }
+#line 574 "src/parser.c"
+yy28:
+                       ++cur;
+#line 322 "src/parser.re"
+                       { NEWTOKEN(PSI_T_COMMA); goto start; }
+#line 579 "src/parser.c"
+yy30:
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '.':       goto yy100;
+                       case '0':       goto yy36;
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':       goto yy38;
+                       default:        goto yy31;
+                       }
+yy31:
+#line 339 "src/parser.re"
+                       { NEWTOKEN(PSI_T_MINUS); goto start; }
+#line 599 "src/parser.c"
+yy32:
+                       yyaccept = 1;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case '.':       goto yy102;
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':       goto yy100;
+                       case 'D':
+                       case 'd':       goto yy104;
+                       case 'F':
+                       case 'L':
+                       case 'f':
+                       case 'l':       goto yy105;
+                       default:        goto yy33;
+                       }
+yy33:
+#line 350 "src/parser.re"
+                       { NEWTOKEN(PSI_T_PERIOD); goto start; }
+#line 626 "src/parser.c"
+yy34:
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '*':       goto yy106;
+                       case '/':       goto yy108;
+                       default:        goto yy35;
+                       }
+yy35:
+#line 340 "src/parser.re"
+                       { NEWTOKEN(PSI_T_SLASH); goto start; }
+#line 637 "src/parser.c"
+yy36:
+                       yyaccept = 2;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case '.':       goto yy110;
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':       goto yy112;
+                       case 'E':
+                       case 'e':       goto yy114;
+                       case 'L':
+                       case 'l':       goto yy115;
+                       case 'U':
+                       case 'u':       goto yy116;
+                       case 'X':
+                       case 'x':       goto yy117;
+                       default:        goto yy37;
+                       }
+yy37:
+#line 424 "src/parser.re"
+                       { NEWTOKEN(PSI_T_NUMBER); goto start; }
+#line 664 "src/parser.c"
+yy38:
+                       yyaccept = 2;
+                       mrk = ++cur;
+                       if ((lim - cur) < 3) if (cur >= lim) goto done;;
+                       yych = *cur;
+                       switch (yych) {
+                       case '.':       goto yy110;
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':       goto yy38;
+                       case 'E':
+                       case 'e':       goto yy114;
+                       case 'L':
+                       case 'l':       goto yy115;
+                       case 'U':
+                       case 'u':       goto yy116;
+                       default:        goto yy37;
+                       }
+yy40:
+                       ++cur;
+#line 323 "src/parser.re"
+                       { NEWTOKEN(PSI_T_COLON); goto start; }
+#line 694 "src/parser.c"
+yy42:
+                       ++cur;
+#line 321 "src/parser.re"
+                       { NEWTOKEN(PSI_T_EOS); goto start; }
+#line 699 "src/parser.c"
+yy44:
+                       yyaccept = 3;
+                       yych = *(mrk = ++cur);
                        switch (yych) {
+                       case '-':
+                       case '.':
+                       case '/':
                        case '0':
                        case '1':
                        case '2':
@@ -507,569 +765,552 @@ yy14:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy89;
-                       default:        goto yy3;
+                       case 'z':       goto yy118;
+                       case '<':       goto yy120;
+                       case '=':       goto yy122;
+                       default:        goto yy45;
                        }
-yy15:
-                       ++P->cur;
-#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 yy92;
-                       default:        goto yy18;
+yy45:
+#line 348 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LCHEVR); goto start; }
+#line 777 "src/parser.c"
+yy46:
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '=':       goto yy124;
+                       default:        goto yy47;
                        }
-yy18:
-#line 335 "src/parser.re"
-                       { NEWTOKEN(PSI_T_AMPERSAND); goto start; }
-#line 528 "src/parser.c"
-yy19:
-                       ++P->cur;
-#line 317 "src/parser.re"
-                       { NEWTOKEN(PSI_T_LPAREN); goto start; }
-#line 533 "src/parser.c"
-yy21:
-                       ++P->cur;
-#line 318 "src/parser.re"
-                       { NEWTOKEN(PSI_T_RPAREN); goto start; }
-#line 538 "src/parser.c"
-yy23:
-                       ++P->cur;
-#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 yy94;
-                       case '0':
-                       case '1':
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5':
-                       case '6':
-                       case '7':
-                       case '8':
-                       case '9':       goto yy34;
-                       default:        goto yy26;
+yy47:
+#line 332 "src/parser.re"
+                       { NEWTOKEN(PSI_T_EQUALS); goto start; }
+#line 787 "src/parser.c"
+yy48:
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '=':       goto yy126;
+                       case '>':       goto yy128;
+                       default:        goto yy49;
                        }
-yy26:
-#line 336 "src/parser.re"
-                       { NEWTOKEN(PSI_T_PLUS); goto start; }
-#line 564 "src/parser.c"
-yy27:
-                       ++P->cur;
-#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 yy94;
-                       case '0':
-                       case '1':
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5':
-                       case '6':
-                       case '7':
-                       case '8':
-                       case '9':       goto yy34;
-                       default:        goto yy30;
-                       }
-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 yy96;
-                       case '0':
-                       case '1':
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5':
-                       case '6':
-                       case '7':
-                       case '8':
-                       case '9':       goto yy97;
-                       default:        goto yy3;
-                       }
-yy32:
-                       ++P->cur;
-                       switch ((yych = *P->cur)) {
-                       case '*':       goto yy99;
-                       case '/':       goto yy101;
-                       default:        goto yy33;
-                       }
-yy33:
-#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 (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
-                       switch (yych) {
-                       case '.':       goto yy94;
-                       case '0':
-                       case '1':
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5':
-                       case '6':
-                       case '7':
-                       case '8':
-                       case '9':       goto yy34;
-                       case 'E':
-                       case 'e':       goto yy103;
-                       default:        goto yy36;
-                       }
-yy36:
-#line 419 "src/parser.re"
-                       { NEWTOKEN(PSI_T_NUMBER); goto start; }
-#line 643 "src/parser.c"
-yy37:
-                       ++P->cur;
-#line 321 "src/parser.re"
-                       { NEWTOKEN(PSI_T_COLON); goto start; }
-#line 648 "src/parser.c"
-yy39:
-                       ++P->cur;
-#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 yy104;
-                       case '=':       goto yy106;
-                       default:        goto yy42;
-                       }
-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 yy108;
-                       default:        goto yy44;
-                       }
-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 yy110;
-                       case '>':       goto yy112;
-                       default:        goto yy46;
-                       }
-yy46:
-#line 347 "src/parser.re"
-                       { NEWTOKEN(PSI_T_RCHEVR); goto start; }
-#line 685 "src/parser.c"
-yy47:
-                       yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+yy49:
+#line 349 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RCHEVR); goto start; }
+#line 798 "src/parser.c"
+yy50:
+                       yyaccept = 4;
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'R':
-                       case 'r':       goto yy114;
-                       default:        goto yy55;
+                       case 'r':       goto yy130;
+                       default:        goto yy58;
                        }
-yy48:
-#line 420 "src/parser.re"
+yy51:
+#line 425 "src/parser.re"
                        { NEWTOKEN(PSI_T_NAME); goto start; }
-#line 697 "src/parser.c"
-yy49:
+#line 810 "src/parser.c"
+yy52:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy116;
-                       default:        goto yy55;
+                       case 'o':       goto yy132;
+                       default:        goto yy58;
                        }
-yy50:
+yy53:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy117;
+                       case 'a':       goto yy133;
                        case 'H':
-                       case 'h':       goto yy118;
+                       case 'h':       goto yy134;
                        case 'O':
-                       case 'o':       goto yy119;
-                       default:        goto yy55;
+                       case 'o':       goto yy135;
+                       default:        goto yy58;
                        }
-yy51:
+yy54:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy120;
+                       case 'e':       goto yy136;
                        case 'O':
-                       case 'o':       goto yy121;
-                       default:        goto yy55;
+                       case 'o':       goto yy137;
+                       default:        goto yy58;
                        }
-yy52:
+yy55:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy122;
+                       case 'l':       goto yy138;
                        case 'N':
-                       case 'n':       goto yy123;
+                       case 'n':       goto yy139;
                        case 'R':
-                       case 'r':       goto yy124;
-                       default:        goto yy55;
+                       case 'r':       goto yy140;
+                       default:        goto yy58;
                        }
-yy53:
+yy56:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy125;
+                       case 'a':       goto yy141;
                        case 'L':
-                       case 'l':       goto yy126;
+                       case 'l':       goto yy142;
                        case 'R':
-                       case 'r':       goto yy127;
+                       case 'r':       goto yy143;
                        case 'U':
-                       case 'u':       goto yy128;
-                       default:        goto yy55;
+                       case 'u':       goto yy144;
+                       default:        goto yy58;
                        }
-yy54:
+yy57:
                        yyaccept = 4;
-                       P->mrk = ++P->cur;
-                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
-yy55:
+                       mrk = ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
+yy58:
                        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 yy48;
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy51;
+                       case '\\':      goto yy131;
+                       default:        goto yy57;
                        }
-yy56:
+yy59:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'F':
-                       case 'f':       goto yy129;
+                       case 'f':       goto yy145;
                        case 'N':
-                       case 'n':       goto yy131;
-                       default:        goto yy55;
+                       case 'n':       goto yy147;
+                       default:        goto yy58;
                        }
-yy57:
+yy60:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
+                       case '"':       goto yy148;
+                       case '\'':      goto yy149;
                        case 'E':
-                       case 'e':       goto yy132;
+                       case 'e':       goto yy150;
                        case 'I':
-                       case 'i':       goto yy133;
+                       case 'i':       goto yy151;
                        case 'O':
-                       case 'o':       goto yy134;
-                       default:        goto yy55;
+                       case 'o':       goto yy152;
+                       default:        goto yy58;
                        }
-yy58:
+yy61:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy135;
-                       default:        goto yy55;
+                       case 'i':       goto yy153;
+                       default:        goto yy58;
                        }
-yy59:
+yy62:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'U':
-                       case 'u':       goto yy136;
-                       default:        goto yy55;
+                       case 'u':       goto yy154;
+                       default:        goto yy58;
                        }
-yy60:
+yy63:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'B':
-                       case 'b':       goto yy137;
-                       default:        goto yy55;
+                       case 'b':       goto yy155;
+                       default:        goto yy58;
                        }
-yy61:
+yy64:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy138;
+                       case 'a':       goto yy156;
                        case 'O':
-                       case 'o':       goto yy139;
+                       case 'o':       goto yy157;
                        case 'R':
-                       case 'r':       goto yy140;
-                       default:        goto yy55;
+                       case 'r':       goto yy158;
+                       default:        goto yy58;
                        }
-yy62:
+yy65:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy141;
-                       default:        goto yy55;
+                       case 'e':       goto yy159;
+                       default:        goto yy58;
                        }
-yy63:
+yy66:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy142;
+                       case 'e':       goto yy160;
                        case 'H':
-                       case 'h':       goto yy143;
+                       case 'h':       goto yy161;
                        case 'I':
-                       case 'i':       goto yy144;
+                       case 'i':       goto yy162;
                        case 'T':
-                       case 't':       goto yy145;
-                       default:        goto yy55;
+                       case 't':       goto yy163;
+                       default:        goto yy58;
                        }
-yy64:
+yy67:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy146;
+                       case 'e':       goto yy164;
                        case 'O':
-                       case 'o':       goto yy147;
+                       case 'o':       goto yy165;
                        case 'R':
-                       case 'r':       goto yy148;
+                       case 'r':       goto yy166;
                        case 'Y':
-                       case 'y':       goto yy149;
-                       default:        goto yy55;
+                       case 'y':       goto yy167;
+                       default:        goto yy58;
                        }
-yy65:
+yy68:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy150;
+                       case 'i':       goto yy168;
                        case 'N':
-                       case 'n':       goto yy151;
-                       default:        goto yy55;
+                       case 'n':       goto yy169;
+                       default:        goto yy58;
                        }
-yy66:
+yy69:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy152;
-                       default:        goto yy55;
+                       case 'o':       goto yy170;
+                       default:        goto yy58;
                        }
-yy67:
+yy70:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy153;
-                       default:        goto yy55;
+                       case 'a':       goto yy171;
+                       default:        goto yy58;
                        }
-yy68:
+yy71:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'V':
-                       case 'v':       goto yy154;
-                       default:        goto yy55;
+                       case 'v':       goto yy172;
+                       default:        goto yy58;
                        }
-yy69:
-                       ++P->cur;
-#line 324 "src/parser.re"
+yy72:
+                       ++cur;
+#line 326 "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':
-                       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 yy155;
-                       default:        goto yy72;
+#line 1075 "src/parser.c"
+yy74:
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case '\\':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy75;
+                       default:        goto yy173;
                        }
-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 341 "src/parser.re"
-                       { NEWTOKEN(PSI_T_CARET); goto start; }
-#line 1031 "src/parser.c"
-yy77:
-                       ++P->cur;
-#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 yy158;
-                       default:        goto yy80;
-                       }
+                       { NEWTOKEN(PSI_T_BSLASH); goto start; }
+#line 1159 "src/parser.c"
+yy76:
+                       ++cur;
+#line 327 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RBRACKET); goto start; }
+#line 1164 "src/parser.c"
+yy78:
+                       ++cur;
+#line 343 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CARET); goto start; }
+#line 1169 "src/parser.c"
 yy80:
-#line 340 "src/parser.re"
-                       { NEWTOKEN(PSI_T_PIPE); goto start; }
-#line 1046 "src/parser.c"
+                       yyaccept = 4;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 'E':
+                       case 'e':       goto yy150;
+                       case 'I':
+                       case 'i':       goto yy151;
+                       case 'O':
+                       case 'o':       goto yy152;
+                       default:        goto yy58;
+                       }
 yy81:
-                       ++P->cur;
-#line 323 "src/parser.re"
-                       { NEWTOKEN(PSI_T_RBRACE); goto start; }
-#line 1051 "src/parser.c"
+                       ++cur;
+#line 324 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LBRACE); goto start; }
+#line 1186 "src/parser.c"
 yy83:
-                       ++P->cur;
-#line 332 "src/parser.re"
-                       { NEWTOKEN(PSI_T_TILDE); goto start; }
-#line 1056 "src/parser.c"
+                       ++cur;
+                       switch ((yych = *cur)) {
+                       case '|':       goto yy176;
+                       default:        goto yy84;
+                       }
+yy84:
+#line 342 "src/parser.re"
+                       { NEWTOKEN(PSI_T_PIPE); goto start; }
+#line 1196 "src/parser.c"
 yy85:
-                       ++P->cur;
-#line 326 "src/parser.re"
-                       { NEWTOKEN(PSI_T_CMP_NE); goto start; }
-#line 1061 "src/parser.c"
+                       ++cur;
+#line 325 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RBRACE); goto start; }
+#line 1201 "src/parser.c"
 yy87:
-                       ++P->cur;
-                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
+                       ++cur;
+#line 334 "src/parser.re"
+                       { NEWTOKEN(PSI_T_TILDE); goto start; }
+#line 1206 "src/parser.c"
+yy89:
+                       ++cur;
+#line 328 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_NE); goto start; }
+#line 1211 "src/parser.c"
+yy91:
+                       ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
                        switch (yych) {
-                       case '"':       goto yy160;
-                       default:        goto yy87;
+                       case '"':       goto yy178;
+                       default:        goto yy91;
                        }
-yy89:
-                       ++P->cur;
-                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
+yy93:
+                       ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case '\\':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy95;
+                       default:        goto yy93;
+                       }
+yy95:
+#line 427 "src/parser.re"
+                       { NEWTOKEN(PSI_T_DOLLAR_NAME); goto start; }
+#line 1295 "src/parser.c"
+yy96:
+                       ++cur;
+#line 330 "src/parser.re"
+                       { NEWTOKEN(PSI_T_AND); goto start; }
+#line 1300 "src/parser.c"
+yy98:
+                       ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
+                       switch (yych) {
+                       case '\'':      goto yy180;
+                       case '\\':      goto yy182;
+                       default:        goto yy98;
+                       }
+yy100:
+                       yyaccept = 2;
+                       mrk = ++cur;
+                       if ((lim - cur) < 2) if (cur >= lim) goto done;;
+                       yych = *cur;
                        switch (yych) {
                        case '0':
                        case '1':
@@ -1080,73 +1321,133 @@ yy89:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':
-                       case 'A':
-                       case 'B':
-                       case 'C':
+                       case '9':       goto yy100;
+                       case 'D':
+                       case 'd':       goto yy104;
+                       case 'F':
+                       case 'L':
+                       case 'f':
+                       case 'l':       goto yy105;
+                       default:        goto yy37;
+                       }
+yy102:
+                       yych = *++cur;
+                       switch (yych) {
+                       case '.':       goto yy184;
+                       default:        goto yy103;
+                       }
+yy103:
+                       cur = mrk;
+                       switch (yyaccept) {
+                       case 0:         goto yy3;
+                       case 1:         goto yy33;
+                       case 2:         goto yy37;
+                       case 3:         goto yy45;
+                       case 4:         goto yy51;
+                       case 5:         goto yy146;
+                       case 6:         goto yy175;
+                       case 7:         goto yy214;
+                       case 8:         goto yy216;
+                       case 9:         goto yy218;
+                       case 10:        goto yy228;
+                       case 11:        goto yy181;
+                       case 12:        goto yy250;
+                       case 13:        goto yy253;
+                       case 14:        goto yy259;
+                       case 15:        goto yy261;
+                       case 16:        goto yy264;
+                       case 17:        goto yy269;
+                       case 18:        goto yy280;
+                       case 19:        goto yy283;
+                       case 20:        goto yy298;
+                       case 21:        goto yy306;
+                       case 22:        goto yy313;
+                       case 23:        goto yy316;
+                       case 24:        goto yy318;
+                       case 25:        goto yy325;
+                       case 26:        goto yy327;
+                       case 27:        goto yy331;
+                       case 28:        goto yy333;
+                       case 29:        goto yy335;
+                       case 30:        goto yy337;
+                       case 31:        goto yy340;
+                       case 32:        goto yy349;
+                       case 33:        goto yy357;
+                       case 34:        goto yy376;
+                       case 35:        goto yy378;
+                       case 36:        goto yy382;
+                       case 37:        goto yy387;
+                       case 38:        goto yy389;
+                       case 39:        goto yy391;
+                       case 40:        goto yy395;
+                       case 41:        goto yy401;
+                       case 42:        goto yy403;
+                       case 43:        goto yy405;
+                       case 44:        goto yy407;
+                       case 45:        goto yy412;
+                       case 46:        goto yy414;
+                       case 47:        goto yy416;
+                       case 48:        goto yy418;
+                       case 49:        goto yy420;
+                       case 50:        goto yy422;
+                       case 51:        goto yy424;
+                       case 52:        goto yy429;
+                       case 53:        goto yy440;
+                       case 54:        goto yy444;
+                       case 55:        goto yy448;
+                       case 56:        goto yy450;
+                       case 57:        goto yy452;
+                       case 58:        goto yy454;
+                       case 59:        goto yy456;
+                       case 60:        goto yy461;
+                       case 61:        goto yy466;
+                       case 62:        goto yy471;
+                       case 63:        goto yy474;
+                       case 64:        goto yy476;
+                       case 65:        goto yy478;
+                       case 66:        goto yy480;
+                       case 67:        goto yy482;
+                       case 68:        goto yy487;
+                       case 69:        goto yy489;
+                       case 70:        goto yy493;
+                       case 71:        goto yy495;
+                       case 72:        goto yy497;
+                       case 73:        goto yy499;
+                       case 74:        goto yy504;
+                       case 75:        goto yy506;
+                       case 76:        goto yy510;
+                       case 77:        goto yy513;
+                       default:        goto yy515;
+                       }
+yy104:
+                       yych = *++cur;
+                       switch (yych) {
                        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 yy89;
-                       default:        goto yy91;
+                       case 'l':       goto yy105;
+                       default:        goto yy103;
                        }
-yy91:
-#line 422 "src/parser.re"
-                       { NEWTOKEN(PSI_T_DOLLAR_NAME); goto start; }
-#line 1143 "src/parser.c"
-yy92:
-                       ++P->cur;
-#line 328 "src/parser.re"
-                       { NEWTOKEN(PSI_T_AND); goto start; }
-#line 1148 "src/parser.c"
-yy94:
-                       yych = *++P->cur;
+yy105:
+                       yych = *++cur;
+                       goto yy37;
+yy106:
+                       ++cur;
+#line 316 "src/parser.re"
+                       { goto comment; }
+#line 1441 "src/parser.c"
+yy108:
+                       ++cur;
+#line 317 "src/parser.re"
+                       { goto comment_sl; }
+#line 1446 "src/parser.c"
+yy110:
+                       yyaccept = 2;
+                       mrk = ++cur;
+                       if ((lim - cur) < 3) if (cur >= lim) goto done;;
+                       yych = *cur;
                        switch (yych) {
                        case '0':
                        case '1':
@@ -1157,101 +1458,41 @@ yy94:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy97;
-                       default:        goto yy95;
-                       }
-yy95:
-                       P->cur = P->mrk;
-                       switch (yyaccept) {
-                       case 0:         goto yy3;
-                       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;
+                       case '9':       goto yy110;
+                       case 'D':
+                       case 'd':       goto yy104;
+                       case 'E':
+                       case 'e':       goto yy114;
+                       case 'F':
+                       case 'L':
+                       case 'f':
+                       case 'l':       goto yy105;
+                       default:        goto yy37;
                        }
-yy96:
-                       yych = *++P->cur;
+yy112:
+                       ++cur;
+                       if ((lim - cur) < 3) if (cur >= lim) goto done;;
+                       yych = *cur;
                        switch (yych) {
-                       case '.':       goto yy162;
-                       default:        goto yy95;
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':       goto yy112;
+                       case 'L':
+                       case 'l':       goto yy115;
+                       case 'U':
+                       case 'u':       goto yy116;
+                       default:        goto yy37;
                        }
-yy97:
-                       yyaccept = 3;
-                       P->mrk = ++P->cur;
-                       if ((P->lim - P->cur) < 3) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
+yy114:
+                       yych = *++cur;
                        switch (yych) {
+                       case '+':
+                       case '-':       goto yy186;
                        case '0':
                        case '1':
                        case '2':
@@ -1261,26 +1502,29 @@ yy97:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy97;
-                       case 'E':
-                       case 'e':       goto yy103;
-                       default:        goto yy36;
+                       case '9':       goto yy100;
+                       default:        goto yy103;
                        }
-yy99:
-                       ++P->cur;
-#line 314 "src/parser.re"
-                       { goto comment; }
-#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;
+yy115:
+                       yyaccept = 2;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 'L':
+                       case 'l':       goto yy187;
+                       case 'U':
+                       case 'u':       goto yy105;
+                       default:        goto yy37;
+                       }
+yy116:
+                       yych = *++cur;
+                       switch (yych) {
+                       case 'L':
+                       case 'l':       goto yy188;
+                       default:        goto yy37;
+                       }
+yy117:
+                       yych = *++cur;
                        switch (yych) {
-                       case '+':
-                       case '-':       goto yy164;
                        case '0':
                        case '1':
                        case '2':
@@ -1290,47 +1534,39 @@ yy103:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy165;
-                       default:        goto yy95;
-                       }
-yy104:
-                       ++P->cur;
-#line 342 "src/parser.re"
-                       { NEWTOKEN(PSI_T_LSHIFT); goto start; }
-#line 1301 "src/parser.c"
-yy106:
-                       ++P->cur;
-#line 344 "src/parser.re"
-                       { NEWTOKEN(PSI_T_CMP_LE); goto start; }
-#line 1306 "src/parser.c"
-yy108:
-                       ++P->cur;
-#line 327 "src/parser.re"
-                       { NEWTOKEN(PSI_T_CMP_EQ); goto start; }
-#line 1311 "src/parser.c"
-yy110:
-                       ++P->cur;
-#line 345 "src/parser.re"
-                       { NEWTOKEN(PSI_T_CMP_GE); goto start; }
-#line 1316 "src/parser.c"
-yy112:
-                       ++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 yy167;
-                       default:        goto yy55;
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':       goto yy189;
+                       default:        goto yy103;
                        }
-yy115:
-                       ++P->cur;
-                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
+yy118:
+                       ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
                        switch (yych) {
+                       case '-':
+                       case '.':
+                       case '/':
+                       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':
@@ -1383,483 +1619,634 @@ yy115:
                        case 'w':
                        case 'x':
                        case 'y':
-                       case 'z':       goto yy155;
-                       default:        goto yy95;
+                       case 'z':       goto yy118;
+                       case '>':       goto yy191;
+                       default:        goto yy103;
                        }
-yy116:
+yy120:
+                       ++cur;
+#line 344 "src/parser.re"
+                       { NEWTOKEN(PSI_T_LSHIFT); goto start; }
+#line 1631 "src/parser.c"
+yy122:
+                       ++cur;
+#line 346 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_LE); goto start; }
+#line 1636 "src/parser.c"
+yy124:
+                       ++cur;
+#line 329 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_EQ); goto start; }
+#line 1641 "src/parser.c"
+yy126:
+                       ++cur;
+#line 347 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CMP_GE); goto start; }
+#line 1646 "src/parser.c"
+yy128:
+                       ++cur;
+#line 345 "src/parser.re"
+                       { NEWTOKEN(PSI_T_RSHIFT); goto start; }
+#line 1651 "src/parser.c"
+yy130:
+                       yyaccept = 4;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 'R':
+                       case 'r':       goto yy193;
+                       default:        goto yy58;
+                       }
+yy131:
+                       ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case '0':
+                       case '1':
+                       case '2':
+                       case '3':
+                       case '4':
+                       case '5':
+                       case '6':
+                       case '7':
+                       case '8':
+                       case '9':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case '\\':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy103;
+                       default:        goto yy173;
+                       }
+yy132:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy168;
-                       default:        goto yy55;
+                       case 'o':       goto yy194;
+                       default:        goto yy58;
                        }
-yy117:
+yy133:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy169;
-                       default:        goto yy55;
+                       case 'l':       goto yy195;
+                       default:        goto yy58;
                        }
-yy118:
+yy134:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy170;
-                       default:        goto yy55;
+                       case 'a':       goto yy196;
+                       default:        goto yy58;
                        }
-yy119:
+yy135:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy171;
+                       case 'n':       goto yy197;
                        case 'U':
-                       case 'u':       goto yy172;
-                       default:        goto yy55;
+                       case 'u':       goto yy198;
+                       default:        goto yy58;
                        }
-yy120:
+yy136:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'F':
-                       case 'f':       goto yy173;
-                       default:        goto yy55;
+                       case 'f':       goto yy199;
+                       default:        goto yy58;
                        }
-yy121:
+yy137:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'U':
-                       case 'u':       goto yy174;
-                       default:        goto yy55;
+                       case 'u':       goto yy200;
+                       default:        goto yy58;
                        }
-yy122:
+yy138:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy175;
+                       case 'i':       goto yy201;
                        case 'S':
-                       case 's':       goto yy176;
-                       default:        goto yy55;
+                       case 's':       goto yy202;
+                       default:        goto yy58;
                        }
-yy123:
+yy139:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'D':
-                       case 'd':       goto yy177;
+                       case 'd':       goto yy203;
                        case 'U':
-                       case 'u':       goto yy178;
-                       default:        goto yy55;
+                       case 'u':       goto yy204;
+                       default:        goto yy58;
                        }
-yy124:
+yy140:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'R':
-                       case 'r':       goto yy179;
-                       default:        goto yy55;
+                       case 'r':       goto yy205;
+                       default:        goto yy58;
                        }
-yy125:
+yy141:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy180;
-                       default:        goto yy55;
+                       case 'l':       goto yy206;
+                       default:        goto yy58;
                        }
-yy126:
+yy142:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy181;
-                       default:        goto yy55;
+                       case 'o':       goto yy207;
+                       default:        goto yy58;
                        }
-yy127:
+yy143:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy182;
-                       default:        goto yy55;
+                       case 'e':       goto yy208;
+                       default:        goto yy58;
                        }
-yy128:
+yy144:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy183;
-                       default:        goto yy55;
+                       case 'n':       goto yy209;
+                       default:        goto yy58;
                        }
-yy129:
+yy145:
                        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;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy146;
                        case 'D':
-                       case 'd':       goto yy184;
+                       case 'd':       goto yy210;
                        case 'N':
-                       case 'n':       goto yy185;
-                       case '\\':      goto yy115;
-                       default:        goto yy130;
+                       case 'n':       goto yy211;
+                       case '\\':      goto yy131;
+                       default:        goto yy57;
                        }
-yy130:
-#line 349 "src/parser.re"
+yy146:
+#line 352 "src/parser.re"
                        { NEWTOKEN(PSI_T_IF); goto start; }
-#line 1573 "src/parser.c"
-yy131:
+#line 1930 "src/parser.c"
+yy147:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
+                       case 'C':
+                       case 'c':       goto yy212;
                        case 'T':
-                       case 't':       goto yy186;
-                       default:        goto yy55;
+                       case 't':       goto yy213;
+                       default:        goto yy58;
                        }
-yy132:
+yy148:
+                       yych = *++cur;
+                       switch (yych) {
+                       case '"':       goto yy103;
+                       default:        goto yy91;
+                       }
+yy149:
+                       yych = *++cur;
+                       switch (yych) {
+                       case '\'':      goto yy103;
+                       default:        goto yy98;
+                       }
+yy150:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy188;
-                       default:        goto yy55;
+                       case 't':       goto yy215;
+                       default:        goto yy58;
                        }
-yy133:
+yy151:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'B':
-                       case 'b':       goto yy190;
-                       default:        goto yy55;
+                       case 'b':       goto yy217;
+                       default:        goto yy58;
                        }
-yy134:
+yy152:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy192;
-                       default:        goto yy55;
+                       case 'n':       goto yy219;
+                       default:        goto yy58;
                        }
-yy135:
+yy153:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'X':
-                       case 'x':       goto yy193;
-                       default:        goto yy55;
+                       case 'x':       goto yy220;
+                       default:        goto yy58;
                        }
-yy136:
+yy154:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy194;
-                       default:        goto yy55;
+                       case 'l':       goto yy221;
+                       default:        goto yy58;
                        }
-yy137:
+yy155:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'J':
-                       case 'j':       goto yy195;
-                       default:        goto yy55;
+                       case 'j':       goto yy222;
+                       default:        goto yy58;
                        }
-yy138:
+yy156:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy196;
-                       default:        goto yy55;
+                       case 't':       goto yy223;
+                       default:        goto yy58;
                        }
-yy139:
+yy157:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'S':
-                       case 's':       goto yy197;
-                       default:        goto yy55;
+                       case 's':       goto yy224;
+                       default:        goto yy58;
                        }
-yy140:
+yy158:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy198;
-                       default:        goto yy55;
+                       case 'e':       goto yy225;
+                       default:        goto yy58;
                        }
-yy141:
+yy159:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy199;
-                       default:        goto yy55;
+                       case 't':       goto yy226;
+                       default:        goto yy58;
                        }
-yy142:
+yy160:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy200;
-                       default:        goto yy55;
+                       case 't':       goto yy227;
+                       default:        goto yy58;
                        }
-yy143:
+yy161:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy202;
-                       default:        goto yy55;
+                       case 'o':       goto yy229;
+                       default:        goto yy58;
                        }
-yy144:
+yy162:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'G':
-                       case 'g':       goto yy203;
-                       default:        goto yy55;
+                       case 'g':       goto yy230;
+                       default:        goto yy58;
                        }
-yy145:
+yy163:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy204;
+                       case 'a':       goto yy231;
                        case 'R':
-                       case 'r':       goto yy205;
-                       default:        goto yy55;
+                       case 'r':       goto yy232;
+                       default:        goto yy58;
                        }
-yy146:
+yy164:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'M':
-                       case 'm':       goto yy206;
-                       default:        goto yy55;
+                       case 'm':       goto yy233;
+                       default:        goto yy58;
                        }
-yy147:
+yy165:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
-                       case '_':       goto yy207;
-                       default:        goto yy55;
+                       case '_':       goto yy234;
+                       default:        goto yy58;
                        }
-yy148:
+yy166:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'U':
-                       case 'u':       goto yy208;
-                       default:        goto yy55;
+                       case 'u':       goto yy235;
+                       default:        goto yy58;
                        }
-yy149:
+yy167:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'P':
-                       case 'p':       goto yy209;
-                       default:        goto yy55;
+                       case 'p':       goto yy236;
+                       default:        goto yy58;
                        }
-yy150:
+yy168:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy210;
-                       default:        goto yy55;
+                       case 'n':       goto yy237;
+                       default:        goto yy58;
                        }
-yy151:
+yy169:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'D':
-                       case 'd':       goto yy211;
+                       case 'd':       goto yy238;
                        case 'I':
-                       case 'i':       goto yy212;
+                       case 'i':       goto yy239;
                        case 'S':
-                       case 's':       goto yy213;
-                       default:        goto yy55;
+                       case 's':       goto yy240;
+                       default:        goto yy58;
                        }
-yy152:
+yy170:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy214;
-                       default:        goto yy55;
+                       case 'i':       goto yy241;
+                       default:        goto yy58;
                        }
-yy153:
+yy171:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'R':
-                       case 'r':       goto yy215;
-                       default:        goto yy55;
+                       case 'r':       goto yy242;
+                       default:        goto yy58;
                        }
-yy154:
+yy172:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy216;
-                       default:        goto yy55;
+                       case 'a':       goto yy243;
+                       default:        goto yy58;
                        }
-yy155:
+yy173:
                        yyaccept = 6;
-                       P->mrk = ++P->cur;
-                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
-                       yych = *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 yy155;
-                       case '\\':      goto yy115;
-                       default:        goto yy157;
+                       mrk = ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy175;
+                       case '\\':      goto yy131;
+                       default:        goto yy173;
                        }
-yy157:
-#line 421 "src/parser.re"
+yy175:
+#line 426 "src/parser.re"
                        { NEWTOKEN(PSI_T_NSNAME); goto start; }
-#line 1846 "src/parser.c"
-yy158:
-                       ++P->cur;
-#line 329 "src/parser.re"
+#line 2218 "src/parser.c"
+yy176:
+                       ++cur;
+#line 331 "src/parser.re"
                        { NEWTOKEN(PSI_T_OR); goto start; }
-#line 1851 "src/parser.c"
-yy160:
-                       ++P->cur;
-#line 423 "src/parser.re"
+#line 2223 "src/parser.c"
+yy178:
+                       ++cur;
+#line 428 "src/parser.re"
                        { NEWTOKEN(PSI_T_QUOTED_STRING); goto start; }
-#line 1856 "src/parser.c"
-yy162:
-                       ++P->cur;
-#line 348 "src/parser.re"
+#line 2228 "src/parser.c"
+yy180:
+                       ++cur;
+yy181:
+#line 429 "src/parser.re"
+                       { NEWTOKEN(PSI_T_QUOTED_CHAR); goto start; }
+#line 2234 "src/parser.c"
+yy182:
+                       ++cur;
+                       if (lim <= cur) if (cur >= lim) goto done;;
+                       yych = *cur;
+                       switch (yych) {
+                       case '\'':      goto yy244;
+                       case '\\':      goto yy182;
+                       default:        goto yy98;
+                       }
+yy184:
+                       ++cur;
+#line 351 "src/parser.re"
                        { NEWTOKEN(PSI_T_ELLIPSIS); goto start; }
-#line 1861 "src/parser.c"
-yy164:
-                       yych = *++P->cur;
+#line 2248 "src/parser.c"
+yy186:
+                       yych = *++cur;
                        switch (yych) {
                        case '0':
                        case '1':
@@ -1870,14 +2257,30 @@ yy164:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy165;
-                       default:        goto yy95;
+                       case '9':       goto yy100;
+                       default:        goto yy103;
                        }
-yy165:
-                       ++P->cur;
-                       if (P->lim <= P->cur) if (P->cur >= P->lim) goto done;;
-                       yych = *P->cur;
+yy187:
+                       yych = *++cur;
+                       switch (yych) {
+                       case 'U':
+                       case 'u':       goto yy105;
+                       default:        goto yy103;
+                       }
+yy188:
+                       yych = *++cur;
+                       switch (yych) {
+                       case 'L':
+                       case 'l':       goto yy105;
+                       default:        goto yy37;
+                       }
+yy189:
+                       yyaccept = 2;
+                       mrk = ++cur;
+                       if ((lim - cur) < 3) if (cur >= lim) goto done;;
+                       yych = *cur;
                        switch (yych) {
+                       case '.':       goto yy245;
                        case '0':
                        case '1':
                        case '2':
@@ -1887,679 +2290,714 @@ yy165:
                        case '6':
                        case '7':
                        case '8':
-                       case '9':       goto yy165;
-                       default:        goto yy36;
+                       case '9':
+                       case 'A':
+                       case 'B':
+                       case 'C':
+                       case 'D':
+                       case 'E':
+                       case 'F':
+                       case 'a':
+                       case 'b':
+                       case 'c':
+                       case 'd':
+                       case 'e':
+                       case 'f':       goto yy189;
+                       case 'L':
+                       case 'l':       goto yy115;
+                       case 'P':
+                       case 'p':       goto yy114;
+                       case 'U':
+                       case 'u':       goto yy116;
+                       default:        goto yy37;
                        }
-yy167:
+yy191:
+                       ++cur;
+#line 430 "src/parser.re"
+                       { NEWTOKEN(PSI_T_CPP_HEADER); goto start; }
+#line 2319 "src/parser.c"
+yy193:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy217;
+                       case 'a':       goto yy247;
                        case 'V':
-                       case 'v':       goto yy218;
-                       default:        goto yy55;
+                       case 'v':       goto yy248;
+                       default:        goto yy58;
                        }
-yy168:
+yy194:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy219;
-                       default:        goto yy55;
+                       case 'l':       goto yy249;
+                       default:        goto yy58;
                        }
-yy169:
+yy195:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy221;
-                       default:        goto yy55;
+                       case 'l':       goto yy251;
+                       default:        goto yy58;
                        }
-yy170:
+yy196:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'R':
-                       case 'r':       goto yy222;
-                       default:        goto yy55;
+                       case 'r':       goto yy252;
+                       default:        goto yy58;
                        }
-yy171:
+yy197:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'S':
-                       case 's':       goto yy224;
-                       default:        goto yy55;
+                       case 's':       goto yy254;
+                       default:        goto yy58;
                        }
-yy172:
+yy198:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'N':
-                       case 'n':       goto yy225;
-                       default:        goto yy55;
+                       case 'n':       goto yy255;
+                       default:        goto yy58;
                        }
-yy173:
+yy199:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy226;
-                       default:        goto yy55;
+                       case 'i':       goto yy256;
+                       default:        goto yy58;
                        }
-yy174:
+yy200:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'B':
-                       case 'b':       goto yy227;
-                       default:        goto yy55;
+                       case 'b':       goto yy257;
+                       default:        goto yy58;
                        }
-yy175:
+yy201:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'F':
-                       case 'f':       goto yy228;
-                       default:        goto yy55;
+                       case 'f':       goto yy258;
+                       default:        goto yy58;
                        }
-yy176:
+yy202:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy230;
-                       default:        goto yy55;
+                       case 'e':       goto yy260;
+                       default:        goto yy58;
                        }
-yy177:
+yy203:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'I':
-                       case 'i':       goto yy232;
-                       default:        goto yy55;
+                       case 'i':       goto yy262;
+                       default:        goto yy58;
                        }
-yy178:
+yy204:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'M':
-                       case 'm':       goto yy233;
-                       default:        goto yy55;
+                       case 'm':       goto yy263;
+                       default:        goto yy58;
                        }
-yy179:
+yy205:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'O':
-                       case 'o':       goto yy235;
-                       default:        goto yy55;
+                       case 'o':       goto yy265;
+                       default:        goto yy58;
                        }
-yy180:
+yy206:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'S':
-                       case 's':       goto yy236;
-                       default:        goto yy55;
+                       case 's':       goto yy266;
+                       default:        goto yy58;
                        }
-yy181:
+yy207:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'A':
-                       case 'a':       goto yy237;
-                       default:        goto yy55;
+                       case 'a':       goto yy267;
+                       default:        goto yy58;
                        }
-yy182:
+yy208:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy238;
-                       default:        goto yy55;
+                       case 'e':       goto yy268;
+                       default:        goto yy58;
                        }
-yy183:
+yy209:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'C':
-                       case 'c':       goto yy240;
-                       default:        goto yy55;
+                       case 'c':       goto yy270;
+                       default:        goto yy58;
                        }
-yy184:
+yy210:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy241;
-                       default:        goto yy55;
+                       case 'e':       goto yy271;
+                       default:        goto yy58;
                        }
-yy185:
+yy211:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'D':
-                       case 'd':       goto yy242;
-                       default:        goto yy55;
+                       case 'd':       goto yy272;
+                       default:        goto yy58;
                        }
-yy186:
-                       yyaccept = 7;
-                       yych = *(P->mrk = ++P->cur);
+yy212:
+                       yyaccept = 4;
+                       yych = *(mrk = ++cur);
                        switch (yych) {
-                       case '0':
-                       case '2':
-                       case '4':
-                       case '5':
-                       case '7':
-                       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 '1':       goto yy243;
-                       case '3':       goto yy244;
-                       case '6':       goto yy245;
-                       case '8':       goto yy246;
+                       case 'l':       goto yy273;
+                       default:        goto yy58;
+                       }
+yy213:
+                       yyaccept = 7;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy214;
+                       case '1':       goto yy274;
+                       case '3':       goto yy275;
+                       case '6':       goto yy276;
+                       case '8':       goto yy277;
                        case 'V':
-                       case 'v':       goto yy247;
-                       case '\\':      goto yy115;
-                       default:        goto yy187;
+                       case 'v':       goto yy278;
+                       case '\\':      goto yy131;
+                       default:        goto yy57;
                        }
-yy187:
-#line 369 "src/parser.re"
+yy214:
+#line 374 "src/parser.re"
                        { NEWTOKEN(PSI_T_INT); goto start; }
-#line 2121 "src/parser.c"
-yy188:
+#line 2562 "src/parser.c"
+yy215:
                        yyaccept = 8;
-                       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 yy189;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy216;
+                       case '\\':      goto yy131;
+                       default:        goto yy57;
                        }
-yy189:
-#line 395 "src/parser.re"
+yy216:
+#line 400 "src/parser.re"
                        { NEWTOKEN(PSI_T_LET); goto start; }
-#line 2195 "src/parser.c"
-yy190:
+#line 2637 "src/parser.c"
+yy217:
                        yyaccept = 9;
-                       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 yy191;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+                       case 0x14:
+                       case 0x15:
+                       case 0x16:
+                       case 0x17:
+                       case 0x18:
+                       case 0x19:
+                       case 0x1A:
+                       case 0x1B:
+                       case 0x1C:
+                       case 0x1D:
+                       case 0x1E:
+                       case 0x1F:
+                       case ' ':
+                       case '!':
+                       case '"':
+                       case '#':
+                       case '$':
+                       case '%':
+                       case '&':
+                       case '\'':
+                       case '(':
+                       case ')':
+                       case '*':
+                       case '+':
+                       case ',':
+                       case '-':
+                       case '.':
+                       case '/':
+                       case ':':
+                       case ';':
+                       case '<':
+                       case '=':
+                       case '>':
+                       case '?':
+                       case '@':
+                       case '[':
+                       case ']':
+                       case '^':
+                       case '`':
+                       case '{':
+                       case '|':
+                       case '}':
+                       case '~':
+                       case 0x7F:      goto yy218;
+                       case '\\':      goto yy131;
+                       default:        goto yy57;
                        }
-yy191:
-#line 394 "src/parser.re"
+yy218:
+#line 399 "src/parser.re"
                        { NEWTOKEN(PSI_T_LIB); goto start; }
-#line 2269 "src/parser.c"
-yy192:
+#line 2712 "src/parser.c"
+yy219:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'G':
-                       case 'g':       goto yy248;
-                       default:        goto yy55;
+                       case 'g':       goto yy279;
+                       default:        goto yy58;
                        }
-yy193:
+yy220:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy250;
-                       default:        goto yy55;
+                       case 'e':       goto yy281;
+                       default:        goto yy58;
                        }
-yy194:
+yy221:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'L':
-                       case 'l':       goto yy251;
-                       default:        goto yy55;
+                       case 'l':       goto yy282;
+                       default:        goto yy58;
                        }
-yy195:
+yy222:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'E':
-                       case 'e':       goto yy253;
+                       case 'e':       goto yy284;
                        case 'V':
-                       case 'v':       goto yy254;
-                       default:        goto yy55;
+                       case 'v':       goto yy285;
+                       default:        goto yy58;
                        }
-yy196:
+yy223:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'H':
-                       case 'h':       goto yy255;
-                       default:        goto yy55;
+                       case 'h':       goto yy286;
+                       default:        goto yy58;
                        }
-yy197:
+yy224:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'T':
-                       case 't':       goto yy256;
-                       default:        goto yy55;
+                       case 't':       goto yy287;
+                       default:        goto yy58;
                        }
-yy198:
+yy225:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
-                       case '_':       goto yy257;
-                       default:        goto yy55;
+                       case '_':       goto yy288;
+                       default:        goto yy58;
                        }
-yy199:
+yy226:
                        yyaccept = 4;
-                       yych = *(P->mrk = ++P->cur);
+                       yych = *(mrk = ++cur);
                        switch (yych) {
                        case 'U':
-                       case 'u':       goto yy258;
-                       default:        goto yy55;
+                       case 'u':       goto yy289;
+                       default:        goto yy58;
                        }
-yy200:
+yy227:
                        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;
+                       yych = *(mrk = ++cur);
+                       switch (yych) {
+                       case 0x00:
+                       case 0x01:
+                       case 0x02:
+                       case 0x03:
+                       case 0x04:
+                       case 0x05:
+                       case 0x06:
+                       case 0x07:
+                       case 0x08:
+                       case '\t':
+                       case '\n':
+                       case '\v':
+                       case '\f':
+                       case '\r':
+                       case 0x0E:
+                       case 0x0F:
+                       case 0x10:
+                       case 0x11:
+                       case 0x12:
+                       case 0x13:
+  &n