1 8 13 package jfun.parsec; 14 15 16 22 public final class Catch1<T> implements Catch<T>, java.io.Serializable { 23 24 29 public Parser<T> catchException(Object v, Object e) { 30 if(e==target) return Parsers.retn(target); 31 else return Parsers.raise("uncaught", e); 32 } 33 private final T target; 34 35 36 40 public Catch1(final T target) { 41 this.target = target; 42 } 43 } 44 | Popular Tags |