42:5cd91fd1526c | 43:1b35c9985989 |
---|---|
55 | 55 |
56 #include "bots.h" | 56 #include "bots.h" |
57 #include "botcommands.h" | 57 #include "botcommands.h" |
58 | 58 |
59 const char* g_Keywords[] = { | 59 const char* g_Keywords[] = { |
60 "state", | |
61 "event", | 60 "event", |
61 "for", | |
62 "goto", | |
63 "if", | |
62 "mainloop", | 64 "mainloop", |
63 "onenter", | 65 "onenter", |
64 "onexit", | 66 "onexit", |
65 "var", | 67 "state", |
66 "goto", | 68 "var" |
67 "if", | |
68 "while", | 69 "while", |
69 | 70 |
70 // These ones aren't implemented yet but I plan to do so, thus they are | 71 // These ones aren't implemented yet but I plan to do so, thus they are |
71 // reserved. Also serves as a to-do list of sorts for me. >:F | 72 // reserved. Also serves as a to-do list of sorts for me. >:F |
72 "break", | 73 "break", |
74 "continue", | 75 "continue", |
75 "default", | 76 "default", |
76 "do", | 77 "do", |
77 "else", | 78 "else", |
78 "enum", // Would enum actually be useful? I think so. | 79 "enum", // Would enum actually be useful? I think so. |
79 "for", | |
80 "func", // Would function support need external support from zandronum? | 80 "func", // Would function support need external support from zandronum? |
81 "return", | 81 "return", |
82 "switch", | 82 "switch", |
83 }; | 83 }; |
84 | 84 |
167 printf ("Parsing script..\n"); | 167 printf ("Parsing script..\n"); |
168 r->BeginParse (w); | 168 r->BeginParse (w); |
169 | 169 |
170 // Parse done, print statistics and write to file | 170 // Parse done, print statistics and write to file |
171 unsigned int globalcount = CountGlobalVars (); | 171 unsigned int globalcount = CountGlobalVars (); |
172 int NumMarks = w->MainBuffer->CountMarks (); | |
173 int NumRefs = w->MainBuffer->CountReferences (); | |
172 printf ("%u / %u global variable%s\n", globalcount, MAX_SCRIPT_VARIABLES, PLURAL (globalcount)); | 174 printf ("%u / %u global variable%s\n", globalcount, MAX_SCRIPT_VARIABLES, PLURAL (globalcount)); |
175 printf ("%d / %d mark%s used\n", NumMarks, MAX_MARKS, PLURAL (NumMarks)); | |
176 printf ("%d / %d ref%s used\n", NumRefs, MAX_MARKS, PLURAL (NumRefs)); | |
173 printf ("%d state%s written\n", g_NumStates, PLURAL (g_NumStates)); | 177 printf ("%d state%s written\n", g_NumStates, PLURAL (g_NumStates)); |
174 printf ("%d event%s written\n", g_NumEvents, PLURAL (g_NumEvents)); | 178 printf ("%d event%s written\n", g_NumEvents, PLURAL (g_NumEvents)); |
175 w->WriteToFile (); | 179 w->WriteToFile (); |
176 | 180 |
177 // Clear out the junk | 181 // Clear out the junk |