diff options
Diffstat (limited to '')
| -rw-r--r-- | MoonParser/moon_parser.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/MoonParser/moon_parser.h b/MoonParser/moon_parser.h new file mode 100644 index 0000000..0c3f427 --- /dev/null +++ b/MoonParser/moon_parser.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <string> | ||
| 4 | #include <codecvt> | ||
| 5 | #include <unordered_set> | ||
| 6 | #include <stack> | ||
| 7 | #include <algorithm> | ||
| 8 | #include <sstream> | ||
| 9 | #include <vector> | ||
| 10 | #include "parserlib.hpp" | ||
| 11 | using namespace parserlib; | ||
| 12 | |||
| 13 | struct State | ||
| 14 | { | ||
| 15 | State() | ||
| 16 | { | ||
| 17 | indents.push(0); | ||
| 18 | stringOpen = -1; | ||
| 19 | } | ||
| 20 | std::stringstream buffer; | ||
| 21 | size_t stringOpen; | ||
| 22 | std::stack<int> indents; | ||
| 23 | std::stack<bool> doStack; | ||
| 24 | std::unordered_set<std::string> keywords = { | ||
| 25 | "and", "while", "else", "using", "continue", | ||
| 26 | "local", "not", "then", "return", "from", | ||
| 27 | "extends", "for", "do", "or", "export", | ||
| 28 | "class", "in", "unless", "when", "elseif", | ||
| 29 | "switch", "break", "if", "with", "import" | ||
| 30 | }; | ||
| 31 | }; | ||
