gobject-ast 0.1.2

AST representation of GObject C code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::Serialize;

use crate::model::{AssignmentOp, Expression, SourceLocation};

#[derive(Debug, Clone, Serialize)]
pub struct Assignment {
    pub lhs: Box<Expression>, // Can be Identifier or FieldAccess
    pub operator: AssignmentOp,
    pub rhs: Box<Expression>,
    pub location: SourceLocation,
}

impl Assignment {
    pub fn lhs_as_text(&self) -> &str {
        self.lhs.location().as_str().unwrap_or("")
    }
}