Skip to content

Commit

Permalink
Recovered reading from file
Browse files Browse the repository at this point in the history
  • Loading branch information
vylion committed Mar 26, 2024
1 parent 7f73bc2 commit 9834b53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Grammar::Grammar() : type{NONE}, content{} {}
Grammar::Grammar(const GrammarType type, const std::string content) : type(type), content(content) {
if (type == COMPILED) {
std::ifstream input(content, std::ios::binary);
compiledBytes = {content.data(), content.data() + content.length()};
compiledBytes = std::vector<char> (
(std::istreambuf_iterator<char>(input)),
(std::istreambuf_iterator<char>()));
input.close();
}
}
Expand Down

0 comments on commit 9834b53

Please sign in to comment.