valkyrie-parser 0.2.5

The hand write parser of valkyrie language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

impl crate::DefineConstraintNode {
    pub(crate) fn build(&self, ctx: &mut ProgramState) -> ConstraintDeclaration {
        ConstraintDeclaration {
            annotations: self.annotation_head.annotations(ctx),
            generics: self.generics(ctx),
            terms: vec![],
        }
    }
    fn generics(&self, ctx: &mut ProgramState) -> Vec<IdentifierNode> {
        match &self.constraint_parameters {
            Some(s) => s.identifier.iter().map(|x| x.build(ctx.file)).collect(),
            None => vec![],
        }
    }
}