yycstate improved
[henge/apc.git] / src / lexer_lex.rl
old mode 100755 (executable)
new mode 100644 (file)
index 5e395d0..be3cbff
@@ -1,8 +1,8 @@
 /* Ragel State Machine for tokenizing text */\r
 #include <stdio.h>\r
 #include <string.h>\r
-#include <apc/apc.h>\r
-#include <apc/parser.tab.h>\r
+#include "apc.h"\r
+#include "parser.tab.h"\r
 \r
 \r
 int ipow(int, int);\r
@@ -60,10 +60,10 @@ struct name* tton(const uint8_t* str, int len)
   int i;\r
   struct name* namep;\r
 \r
-  namep = (name*) malloc(MAX_NAME_LEN);\r
+  namep = (struct name*) malloc(MAX_NAME_LEN);\r
   for(i = 0; i < MAX_NAME_LEN - 1; i++)\r
-    namep[i] = str[i];\r
-  namep[i] = '\0';\r
+    namep->name[i] = str[i];\r
+  namep->name[i] = '\0';\r
 \r
   return namep;\r
 }\r