mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-27 05:18:46 +08:00
✨ add new import & use c++17
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
enum class expr_type:u32 {
|
||||
ast_null=0, // null node
|
||||
ast_file_info, // stores file info
|
||||
ast_block, // code block
|
||||
ast_nil, // nil keyword
|
||||
ast_num, // number, basic value type
|
||||
@@ -73,6 +74,21 @@ public:
|
||||
virtual void accept(ast_visitor*);
|
||||
};
|
||||
|
||||
class file_info:public expr {
|
||||
private:
|
||||
uint16_t index;
|
||||
std::string filename;
|
||||
|
||||
public:
|
||||
file_info(const span& location, uint16_t file_index, const std::string& name):
|
||||
expr(location, expr_type::ast_file_info),
|
||||
index(file_index), filename(name) {}
|
||||
~file_info() = default;
|
||||
uint16_t get_index() const {return index;}
|
||||
const std::string& get_file_name() const {return filename;}
|
||||
void accept(ast_visitor*) override;
|
||||
};
|
||||
|
||||
class null_expr:public expr {
|
||||
public:
|
||||
null_expr(const span& location):
|
||||
|
||||
Reference in New Issue
Block a user