factorio-ir 0.1.2

Intermediate representation for factorio-rs Rust-to-Lua transpilation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{debug::StructDebug, expression::Expression, function::Function, r#type::Type};

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct StructField {
    pub name: String,
    pub ty: Type,
    pub source_type: Option<String>,
}

#[derive(Debug, Clone, PartialEq)]
pub struct Struct {
    pub name: String,
    pub fields: Vec<StructField>,
    pub constants: Vec<(String, Expression)>,
    pub methods: Vec<Function>,
    pub doc: Option<String>,
    pub debug: Option<StructDebug>,
}