Skip to content

Commit a5aeae7

Browse files
committed
Rename Error*
1 parent b2acd79 commit a5aeae7

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

peg-macros/analysis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<'a> LeftRecursionVisitor<'a> {
164164
nullable
165165
}
166166

167-
LiteralExpr(_) | PatternExpr(_) | MethodExpr(_, _) | FailExpr(_) | RecoverIfExpr(..) | RecoverUnlessExpr(..) |MarkerExpr(_) => false,
167+
LiteralExpr(_) | PatternExpr(_) | MethodExpr(_, _) | FailExpr(_) | ErrorIfExpr(..) | ErrorUnlessExpr(..) |MarkerExpr(_) => false,
168168

169169
PositionExpr => true,
170170
}
@@ -272,7 +272,7 @@ impl<'a> LoopNullabilityVisitor<'a> {
272272
nullable
273273
}
274274

275-
LiteralExpr(_) | PatternExpr(_) | MethodExpr(_, _) | FailExpr(_) | RecoverIfExpr(..) | RecoverUnlessExpr(..) | MarkerExpr(_) => false,
275+
LiteralExpr(_) | PatternExpr(_) | MethodExpr(_, _) | FailExpr(_) | ErrorIfExpr(..) | ErrorUnlessExpr(..) | MarkerExpr(_) => false,
276276
PositionExpr => true,
277277
}
278278
}

peg-macros/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ pub enum Expr {
8585
PositionExpr,
8686
QuietExpr(Box<SpannedExpr>),
8787
FailExpr(Literal),
88-
RecoverIfExpr(Box<SpannedExpr>, Literal, Box<SpannedExpr>),
89-
RecoverUnlessExpr(Box<SpannedExpr>, Literal, Box<SpannedExpr>),
88+
ErrorIfExpr(Box<SpannedExpr>, Literal, Box<SpannedExpr>),
89+
ErrorUnlessExpr(Box<SpannedExpr>, Literal, Box<SpannedExpr>),
9090
PrecedenceExpr {
9191
levels: Vec<PrecedenceLevel>,
9292
},

peg-macros/grammar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3462,7 +3462,7 @@ pub mod peg {
34623462
__err_state,
34633463
__pos,
34643464
);
3465-
match __seq_res { :: peg :: RuleResult :: Matched (__pos , sp) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "error") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "!") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "{") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_LITERAL (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , s) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "}") { :: peg :: RuleResult :: Matched (__pos , __val) => { :: peg :: RuleResult :: Matched (__pos , (|| { RecoverIfExpr (Box :: new (ActionExpr (vec ! [] , None) . at (sp)) , s , Box :: new (seq)) . at (sp) }) ()) } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"}\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"{\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"!\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"error\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , }
3465+
match __seq_res { :: peg :: RuleResult :: Matched (__pos , sp) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "error") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "!") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "{") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_LITERAL (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , s) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "}") { :: peg :: RuleResult :: Matched (__pos , __val) => { :: peg :: RuleResult :: Matched (__pos , (|| { ErrorIfExpr (Box :: new (ActionExpr (vec ! [] , None) . at (sp)) , s , Box :: new (seq)) . at (sp) }) ()) } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"}\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"{\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"!\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"error\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , }
34663466
};
34673467
match __choice_res {
34683468
::peg::RuleResult::Matched(__pos, __value) => {
@@ -3479,7 +3479,7 @@ pub mod peg {
34793479
__err_state,
34803480
__pos,
34813481
);
3482-
match __seq_res { :: peg :: RuleResult :: Matched (__pos , sp) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "error_if") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "!") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "{") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq1) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "|") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_LITERAL (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , s) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq2) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "}") { :: peg :: RuleResult :: Matched (__pos , __val) => { :: peg :: RuleResult :: Matched (__pos , (|| { RecoverIfExpr (Box :: new (seq1) , s , Box :: new (seq2)) . at (sp) }) ()) } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"}\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"|\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"{\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"!\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"error_if\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , }
3482+
match __seq_res { :: peg :: RuleResult :: Matched (__pos , sp) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "error_if") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "!") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "{") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq1) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "|") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_LITERAL (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , s) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq2) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "}") { :: peg :: RuleResult :: Matched (__pos , __val) => { :: peg :: RuleResult :: Matched (__pos , (|| { ErrorIfExpr (Box :: new (seq1) , s , Box :: new (seq2)) . at (sp) }) ()) } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"}\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"|\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"{\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"!\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"error_if\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , }
34833483
};
34843484
match __choice_res {
34853485
::peg::RuleResult::Matched(
@@ -3499,7 +3499,7 @@ pub mod peg {
34993499
__err_state,
35003500
__pos,
35013501
);
3502-
match __seq_res { :: peg :: RuleResult :: Matched (__pos , sp) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "error_unless") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "!") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "{") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq1) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "|") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_LITERAL (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , s) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq2) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "}") { :: peg :: RuleResult :: Matched (__pos , __val) => { :: peg :: RuleResult :: Matched (__pos , (|| { RecoverUnlessExpr (Box :: new (seq1) , s , Box :: new (seq2)) . at (sp) }) ()) } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"}\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"|\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"{\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"!\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"error_unless\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , }
3502+
match __seq_res { :: peg :: RuleResult :: Matched (__pos , sp) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "error_unless") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "!") { :: peg :: RuleResult :: Matched (__pos , __val) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "{") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq1) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "|") { :: peg :: RuleResult :: Matched (__pos , __val) => { { let __seq_res = __parse_LITERAL (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , s) => { { let __seq_res = __parse_sequence (__input , __state , __err_state , __pos) ; match __seq_res { :: peg :: RuleResult :: Matched (__pos , seq2) => { match :: peg :: ParseLiteral :: parse_string_literal (__input , __pos , "}") { :: peg :: RuleResult :: Matched (__pos , __val) => { :: peg :: RuleResult :: Matched (__pos , (|| { ErrorUnlessExpr (Box :: new (seq1) , s , Box :: new (seq2)) . at (sp) }) ()) } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"}\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"|\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"{\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"!\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => { __err_state . mark_error (__e) ; :: peg :: RuleResult :: Error (__e) } :: peg :: RuleResult :: Failed => { __err_state . mark_failure (__pos , "\"error_unless\"") ; :: peg :: RuleResult :: Failed } } } :: peg :: RuleResult :: Error (__e) => :: peg :: RuleResult :: Error (__e) , :: peg :: RuleResult :: Failed => :: peg :: RuleResult :: Failed , }
35033503
};
35043504
match __choice_res {
35053505
::peg::RuleResult::Matched(

0 commit comments

Comments
 (0)