diff options
| author | Shagun Agrawal <agrawalshagun07@gmail.com> | 2024-07-24 22:59:02 +0530 |
|---|---|---|
| committer | Shagun Agrawal <agrawalshagun07@gmail.com> | 2024-07-24 22:59:02 +0530 |
| commit | b17a2610bd3d7293d1ae59c5531121e78859e7ea (patch) | |
| tree | 8f115e357a0e949177aff699c50cbb6c948bdf11 /src/cljcc/parser.clj | |
| parent | e81e86e937584a7f2345df43dc93a13793d10dc2 (diff) | |
throw exception in case of parsing failure
passed chapter 1 tests
Diffstat (limited to 'src/cljcc/parser.clj')
| -rw-r--r-- | src/cljcc/parser.clj | 3 |
1 files changed, 3 insertions, 0 deletions
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)) |
