From b17a2610bd3d7293d1ae59c5531121e78859e7ea Mon Sep 17 00:00:00 2001 From: Shagun Agrawal Date: Wed, 24 Jul 2024 22:59:02 +0530 Subject: throw exception in case of parsing failure passed chapter 1 tests --- src/cljcc/parser.clj | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/cljcc/parser.clj') diff --git a/src/cljcc/parser.clj b/src/cljcc/parser.clj index 3c54012..860fcd5 100644 --- a/src/cljcc/parser.clj +++ b/src/cljcc/parser.clj @@ -17,6 +17,9 @@ keyword = #'int\\b' | #'return\\b' | #'void\\b'" :auto-whitespace whitespace)) +(defn parseable? [result] + (not (insta/failure? result))) + (defn parse [source] (c-parser source)) -- cgit v1.2.3