Switch to using header guards instead of pragma once
This commit is contained in:
parent
9cbb61939d
commit
aa800e4201
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef ERROR_HANDLER_HH
|
||||
#define ERROR_HANDLER_HH
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -9,3 +10,5 @@ struct ErrorHandler {
|
||||
|
||||
bool had_error;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "interpreter.hh"
|
||||
#include "error_handler.hh"
|
||||
#include "scanner.hh"
|
||||
#include "tokenizer.hh"
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
@ -1,3 +1,6 @@
|
||||
#pragma once
|
||||
#ifndef INTERPRETER_HH
|
||||
#define INTERPRETER_HH
|
||||
|
||||
void run_interpreter(int argc, char *argv[]);
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef OBJECT_HH
|
||||
#define OBJECT_HH
|
||||
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
@ -33,3 +34,5 @@ struct Object {
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const ObjectType &type);
|
||||
std::ostream &operator<<(std::ostream &os, const Object &obj);
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
#include "scanner.hh"
|
||||
#include "token.hh"
|
||||
#include "error_handler.hh"
|
||||
#include "object.hh"
|
||||
#include "../error_handler.hh"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef SCANNER_HH
|
||||
#define SCANNER_HH
|
||||
|
||||
#include "token.hh"
|
||||
#include <cstddef>
|
||||
@ -29,3 +30,5 @@ struct Scanner {
|
||||
std::size_t start, current, line;
|
||||
std::unordered_map<std::string, TokenType> keywords;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef TOKEN_HH
|
||||
#define TOKEN_HH
|
||||
|
||||
#include "object.hh"
|
||||
#include <cstdint>
|
||||
@ -39,3 +40,5 @@ struct Token {
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const TokenType &type);
|
||||
std::ostream &operator<<(std::ostream &os, const Token &token);
|
||||
|
||||
#endif
|
8
cclox_src/tokenizer.cc
Normal file
8
cclox_src/tokenizer.cc
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef TOKENIZER_CC
|
||||
#define TOKENIZER_CC
|
||||
|
||||
#include "scanner/object.cc"
|
||||
#include "scanner/token.cc"
|
||||
#include "scanner/scanner.cc"
|
||||
|
||||
#endif
|
8
cclox_src/tokenizer.hh
Normal file
8
cclox_src/tokenizer.hh
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef TOKENIZER_HH
|
||||
#define TOKENIZER_HH
|
||||
|
||||
#include "scanner/object.hh"
|
||||
#include "scanner/token.hh"
|
||||
#include "scanner/scanner.hh"
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user