Skip to content

Commit

Permalink
Use correct type.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Dec 27, 2023
1 parent f04afe4 commit 9ce9707
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/File.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void File::parse(const std::filesystem::path& filename) {
throw Exception("invalid token");
}
} catch (Exception& ex) {
std::cerr << tokenizer.file_name() << ":" << tokenizer.current_line_number() << ": " << ex.what() << std::endl;
std::cerr << tokenizer.file_name().string() << ":" << tokenizer.current_line_number() << ": " << ex.what() << std::endl;
throw Exception();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Tokenizer {
void skip_whitespace();
void unget(const Token& token);
[[nodiscard]] int current_line_number() const {return line_number;}
[[nodiscard]] const std::string&file_name() const {return filename;}
[[nodiscard]] const std::filesystem::path& file_name() const {return filename;}

private:
static CharacterType type(int c);
Expand All @@ -121,7 +121,7 @@ class Tokenizer {
static std::unordered_map<std::string, TokenType> keywords;
static std::unordered_map<int, CharacterType> special_characters;

std::string filename;
std::filesystem::path filename;
std::ifstream source;
std::optional<Token> ungot;
bool beggining_of_line = true;
Expand Down

0 comments on commit 9ce9707

Please sign in to comment.