neo_solidity/
context.rs

1//! Compiler Context
2//!
3//! Shared state during compilation.
4
5use std::collections::HashMap;
6
7/// Compilation context
8#[derive(Default)]
9pub struct CompilerContext {
10    pub symbols: HashMap<String, String>,
11    pub errors_count: usize,
12    pub warnings_count: usize,
13}
14
15impl CompilerContext {
16    pub fn new() -> Self {
17        Self::default()
18    }
19
20    pub fn has_errors(&self) -> bool {
21        self.errors_count > 0
22    }
23}