yog-script-analyze 0.4.0

Yog Script (.ys, .yns) analyzed: its lexer, parser and syntax tree, names resolved, the class index model — what the build and the editors read a source with.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `try`.

use crate::ast::{Expr, UnOp};
use crate::parser::{PResult, Parser};
use crate::words::{Role, Word};

pub static WORD: Word = Word {
    text: "try",
    doc: "Takes a result's value, or ends this method with its failure: `let v = try Parse(text);`.",
    reserved: true,
    roles: &[Role::Prefix { starts: None, parse }],
};

fn parse(p: &mut Parser) -> PResult<Expr> {
    p.prefixed(UnOp::Try)
}