]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Parser.cpp
added error message for unreadable files in Parser
[l2e.git] / src / loader / Parser.cpp
index 6ced1be4ee38707641c9cd7be956c73b6812082a..d6abcc39561e4b70f8fce0ced7ce880580701ad0 100644 (file)
@@ -17,6 +17,16 @@ using std::vector;
 
 namespace loader {
 
+Parser::Parser(const char *file, ParsedSource &product)
+: file(file)
+, in(file)
+, tok(in)
+, product(product) {
+       if (!in) {
+               throw Error(file, 0, "unable to read file");
+       }
+}
+
 void Parser::Parse() {
        while (tok.HasMore()) {
                ParseStatement();