Skip to content

Commit

Permalink
add UnwindSafe
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Tauber committed Nov 20, 2022
1 parent 7f8e605 commit bcad813
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vm/src/lib.rs
Expand Up @@ -24,15 +24,16 @@ use pest_meta::ast::RuleType;
use pest_meta::optimizer::{OptimizedExpr, OptimizedRule};

use std::collections::HashMap;
use std::panic::RefUnwindSafe;
use std::panic::{RefUnwindSafe, UnwindSafe};

mod macros;

/// A callback function that is called when a rule is matched.
/// The first argument is the name of the rule and the second is the span of the rule.
/// The function should return `true` if parsing should be terminated
/// (if the new parsing session was started) or `false` otherwise.
type ListenerFn = Box<dyn Fn(String, &Position<'_>) -> bool + Sync + Send + RefUnwindSafe>;
type ListenerFn =
Box<dyn Fn(String, &Position<'_>) -> bool + Sync + Send + RefUnwindSafe + UnwindSafe>;

/// A virtual machine-like construct that runs an AST on-the-fly
pub struct Vm {
Expand Down

0 comments on commit bcad813

Please sign in to comment.