Sign in

    jaredzhou/mooncedar/parser does not have a README file

    ParseError

    pub(all) suberror ParseError {
    ParseError(String,
    Position
    )
    } derive(
    Debug
    )

    Keyword

    pub(all) enum Keyword {
    Permit
    Forbid
    When
    Unless
    In
    Has
    Like
    Is
    If
    Then
    Else
    } derive(Eq,
    Debug
    )

    Reserved keywords — matched by the lexer before user identifiers. principal/action/resource/context are NOT keywords; they are Lower(...) since they can appear as user identifiers.
    impl Show for Keyword

    Operator

    pub(all) enum Operator {
    Add
    Sub
    Mul
    Eq
    Ne
    Lt
    Gt
    Le
    Ge
    And
    Or
    Not
    } derive(Eq,
    Debug
    )

    impl Show for Operator

    TokenKind

    pub(all) enum TokenKind {
    Bool(Bool)
    Int(Int64)
    String(String)
    Ident(String)
    Keyword(Keyword)
    Op(Operator)
    Bracket(Char)
    Symbol(String)
    Unknown
    EOF
    } derive(Eq,
    Debug
    )

    impl Show for TokenKind

    parse_expr

    parse_policies

    fn parse_policies(src : String) -> Array[
    Policy
    ] raise ParseError

    Parse one or more Cedar policies from source text. Each policy is validated immediately after parsing.

    stringify

    fn stringify(p :
    Policy
    ) -> String

    Convert Policy to Cedar source text.

    stringify_expr

    fn stringify_expr(e :
    Expr
    ) -> String

    Convert Expr to Cedar source text.

    tokenize

    fn tokenize(code : String, filename? : String) -> Array[Token]