]> gitweb.factorcode.org Git - factor.git/commitdiff
missing file
authorSlava Pestov <slava@factorcode.org>
Fri, 24 Jun 2005 03:32:14 +0000 (03:32 +0000)
committerSlava Pestov <slava@factorcode.org>
Fri, 24 Jun 2005 03:32:14 +0000 (03:32 +0000)
library/syntax/parse-errors.factor [new file with mode: 0644]

diff --git a/library/syntax/parse-errors.factor b/library/syntax/parse-errors.factor
new file mode 100644 (file)
index 0000000..7ec2e75
--- /dev/null
@@ -0,0 +1,12 @@
+! Copyright (C) 2005 Slava Pestov.
+! See http://factor.sf.net/license.txt for BSD license.
+IN: parser
+USING: errors generic kernel namespaces io ;
+
+TUPLE: parse-error file line col text ;
+
+: parse-error ( msg -- )
+    file get line-number get "col" get "line" get
+    <parse-error> [ set-delegate ] keep throw ;
+
+: with-parser ( quot -- ) [ [ parse-error ] when* ] catch ;