Kaynağa Gözat

more division of things in dynamic

channel
Ludovic 'Archivist' Lagouardette 3 yıl önce
ebeveyn
işleme
39d7c97984
2 değiştirilmiş dosya ile 34 ekleme ve 0 silme
  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 Dosyayı Görüntüle

@ -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 Dosyayı Görüntüle

@ -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;
};

Yükleniyor…
İptal
Kaydet