added push map token instead of ~
[henge/apc.git] / src / lexer.c
index 1550db9..b01b292 100644 (file)
@@ -28,6 +28,7 @@
 #include <dirent.h>
 
 /* Local */
+#include "apc.h"
 #include "parser.tab.h"
 #ifndef DE_STACKSIZE
 #define DE_STACKSIZE 1024
@@ -54,8 +55,6 @@ extern //scanner.c
 int         scanner_init(void);
 extern //scanner.c
 int         scanner(void);
-static inline
-int         dredge_current_depth(void);
 extern //bison
 YYSTYPE     yylval;
 static
@@ -128,7 +127,7 @@ int lexer
    start:
   while (DE_LEN() > 0)//lex any directory entries in our stack
     {
-      if (lexer_lexfile(DE_POP()->d_name) == 0)
+      if (lexer_lexfile((uint8_t*)DE_POP()->d_name) == 0)
        FAIL("Lexer failed to tokenize [%s]\n",(*DE_STACKB)->d_name);
     }
   if (TK_EMPTY)           //if there are no tokens,
@@ -198,7 +197,7 @@ uint8_t const* lexer_get_current_filepath
 { static uint8_t        current_path[FPATH_MAX];
   static uint8_t const* last_filename;
   if ((!last_filename || last_filename != current_filename) &&
-      ((uint8_t*) realpath(current_filename, current_path) != (uint8_t*) current_path))
+      ((uint8_t*) realpath((char*)current_filename, (char*)current_path) != (uint8_t*) current_path))
     { perror("realpath: ");
       return NULL;
     }
@@ -221,7 +220,7 @@ int lexer_lexfilename
   /* Determine the filetype of str */
   len = u8_strlen(str);
     
-  ntok += lexer_lexstring(str, len);
+  ntok = lexer_lexstring(str, len);
   
   /* Pass back filepath as end of statment operator */
   filepath = u8_strdup(lexer_get_current_filepath());