Преглед на файлове

more division of things in dynamic

channel
Ludovic 'Archivist' Lagouardette преди 3 години
родител
ревизия
39d7c97984
променени са 2 файла, в които са добавени 34 реда и са изтрити 0 реда
  1. +5
    -0
      include/gp/dynamic/compiler/type/decls.hpp
  2. +29
    -0
      include/gp/dynamic/compiler/type/variable.hpp

+ 5
- 0
include/gp/dynamic/compiler/type/decls.hpp Целия файл

@ -0,0 +1,5 @@
#pragma once
enum class gr_base_type;
struct gr_type;
struct gr_variable;

+ 29
- 0
include/gp/dynamic/compiler/type/variable.hpp Целия файл

@ -0,0 +1,29 @@
#pragma once
#include "gp/dynamic/compiler/type/type.hpp"
struct gr_variable {
/// Its type.
gr_type type;
/// Register position, separate for each type (int, float, string and objects);
size_t _register = std::numeric_limits<decltype(_register)>::max();
/// Declared from the global scope ?
bool is_global;
/// Declared from an object definition ?
bool is_field;
/// Does it have a value yet ?
bool is_initialized;
/// Is the type to be infered automatically ? (e.g. the `let` keyword).
bool is_auto;
/// Can we modify its value ?
bool is_constant;
/// Its unique name inside its scope (function based scope).
string name;
/// Is the variable visible from other files ? (Global only)
bool is_public;
/// The file where the variable is declared.
size_t file_id;
/// Position information in case of errors.
size_t lex_position;
};

Зареждане…
Отказ
Запис