let_callback: optional call variable list
[m6w6/ext-psi] / src / parser.re
index e57353662c59fef7bef95e4adffeeba710074900..3fdd8660905258b11b281b0d4ca8d5b3a386c913 100644 (file)
@@ -263,6 +263,8 @@ struct psi_plist *psi_parser_scan(struct psi_parser *P, struct psi_parser_input
        bool escaped;
        token_t char_width;
 
+       PSI_DEBUG_PRINT(P, "PSI: scanning %s\n", I->file);
+
        tok = mrk = eol = cur = I->buffer;
        lim = I->buffer + I->length;
        I->lines = 1;
@@ -273,6 +275,8 @@ struct psi_plist *psi_parser_scan(struct psi_parser *P, struct psi_parser_input
                ctxmrk = NULL;
                tok = cur;
 
+               (void) ctxmrk;
+
                /*!re2c
 
                re2c:indent:top = 2;
@@ -364,10 +368,28 @@ struct psi_plist *psi_parser_scan(struct psi_parser *P, struct psi_parser_input
                "?"                             { NEWTOKEN(PSI_T_IIF); goto start; }
                "pragma"                { NEWTOKEN(PSI_T_PRAGMA); goto start; }
                "pragma" W+ "once"      { NEWTOKEN(PSI_T_PRAGMA_ONCE); goto start; }
+               "__inline"              { NEWTOKEN(PSI_T_CPP_INLINE); goto start; }
                "__restrict"    { NEWTOKEN(PSI_T_CPP_RESTRICT); goto start; }
                "__extension__" { NEWTOKEN(PSI_T_CPP_EXTENSION); goto start; }
                "__asm__"               { NEWTOKEN(PSI_T_CPP_ASM); goto start; }
+               "volatile"              { NEWTOKEN(PSI_T_VOLATILE); goto start; }
+               "sizeof"                { NEWTOKEN(PSI_T_SIZEOF); goto start; }
                "line"                  { NEWTOKEN(PSI_T_LINE); goto start; }
+               "typedef"               { NEWTOKEN(PSI_T_TYPEDEF); goto start; }
+               "struct"                { NEWTOKEN(PSI_T_STRUCT); goto start; }
+               "union"                 { NEWTOKEN(PSI_T_UNION); goto start; }
+               "enum"                  { NEWTOKEN(PSI_T_ENUM); goto start; }
+               "const"                 { NEWTOKEN(PSI_T_CONST); goto start; }
+               "void"                  { NEWTOKEN(PSI_T_VOID); goto start; }
+               "bool"                  { NEWTOKEN(PSI_T_BOOL); goto start; }
+               "char"                  { NEWTOKEN(PSI_T_CHAR); goto start; }
+               "short"                 { NEWTOKEN(PSI_T_SHORT); goto start; }
+               "int"                   { NEWTOKEN(PSI_T_INT); goto start; }
+               "long"                  { NEWTOKEN(PSI_T_LONG); goto start; }
+               "float"                 { NEWTOKEN(PSI_T_FLOAT); goto start; }
+               "double"                { NEWTOKEN(PSI_T_DOUBLE); goto start; }
+               "unsigned"              { NEWTOKEN(PSI_T_UNSIGNED); goto start; }
+               "signed"                { NEWTOKEN(PSI_T_SIGNED); goto start; }
                'IF'                    { NEWTOKEN(PSI_T_IF); goto start; }
                'IFDEF'                 { NEWTOKEN(PSI_T_IFDEF); goto start; }
                'IFNDEF'                { NEWTOKEN(PSI_T_IFNDEF); goto start; }
@@ -386,41 +408,19 @@ struct psi_plist *psi_parser_scan(struct psi_parser *P, struct psi_parser_input
                'NULL'                  { NEWTOKEN(PSI_T_NULL); goto start; }
                'MIXED'                 { NEWTOKEN(PSI_T_MIXED); goto start; }
                'CALLABLE'              { NEWTOKEN(PSI_T_CALLABLE); goto start; }
-               'VOID'                  { NEWTOKEN(PSI_T_VOID); goto start; }
-               'BOOL'                  { NEWTOKEN(PSI_T_BOOL); goto start; }
-               'CHAR'                  { NEWTOKEN(PSI_T_CHAR); goto start; }
-               'SHORT'                 { NEWTOKEN(PSI_T_SHORT); goto start; }
-               'INT'                   { NEWTOKEN(PSI_T_INT); goto start; }
-               'LONG'                  { NEWTOKEN(PSI_T_LONG); goto start; }
-               'FLOAT'                 { NEWTOKEN(PSI_T_FLOAT); goto start; }
-               'DOUBLE'                { NEWTOKEN(PSI_T_DOUBLE); goto start; }
-               'INT8_T'                { NEWTOKEN(PSI_T_INT8); goto start; }
-               'UINT8_T'               { NEWTOKEN(PSI_T_UINT8); goto start; }
-               'INT16_T'               { NEWTOKEN(PSI_T_INT16); goto start; }
-               'UINT16_T'              { NEWTOKEN(PSI_T_UINT16); goto start; }
-               'INT32_T'               { NEWTOKEN(PSI_T_INT32); goto start; }
-               'UINT32_T'              { NEWTOKEN(PSI_T_UINT32); goto start; }
-               'INT64_T'               { NEWTOKEN(PSI_T_INT64); goto start; }
-               'UINT64_T'              { NEWTOKEN(PSI_T_UINT64); goto start; }
-               'UNSIGNED'              { NEWTOKEN(PSI_T_UNSIGNED); goto start; }
-               'SIGNED'                { NEWTOKEN(PSI_T_SIGNED); goto start; }
                'STRING'                { NEWTOKEN(PSI_T_STRING); goto start; }
                'ARRAY'                 { NEWTOKEN(PSI_T_ARRAY); goto start; }
                'OBJECT'                { NEWTOKEN(PSI_T_OBJECT); goto start; }
                'CALLBACK'              { NEWTOKEN(PSI_T_CALLBACK); goto start; }
                'STATIC'                { NEWTOKEN(PSI_T_STATIC); goto start; }
                'FUNCTION'              { NEWTOKEN(PSI_T_FUNCTION); goto start; }
-               'TYPEDEF'               { NEWTOKEN(PSI_T_TYPEDEF); goto start; }
-               'STRUCT'                { NEWTOKEN(PSI_T_STRUCT); goto start; }
-               'UNION'                 { NEWTOKEN(PSI_T_UNION); goto start; }
-               'ENUM'                  { NEWTOKEN(PSI_T_ENUM); goto start; }
-               'CONST'                 { NEWTOKEN(PSI_T_CONST); goto start; }
                'LIB'                   { NEWTOKEN(PSI_T_LIB); goto start; }
                'LET'                   { NEWTOKEN(PSI_T_LET); goto start; }
                'SET'                   { NEWTOKEN(PSI_T_SET); goto start; }
                'PRE_ASSERT'    { NEWTOKEN(PSI_T_PRE_ASSERT); goto start; }
                'POST_ASSERT'   { NEWTOKEN(PSI_T_POST_ASSERT); goto start; }
                'RETURN'                { NEWTOKEN(PSI_T_RETURN); goto start; }
+               'AS'                    { NEWTOKEN(PSI_T_AS); goto start; }
                'FREE'                  { NEWTOKEN(PSI_T_FREE); goto start; }
                'TEMP'                  { NEWTOKEN(PSI_T_TEMP); goto start; }
                'STRLEN'                { NEWTOKEN(PSI_T_STRLEN); goto start; }