aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-07 23:51:10 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-07 23:51:10 +1300
commitf9148bb172e68e0f584c1040e92f34ea3959b94e (patch)
tree6708c7224dffce003c377890903bb8bd2a54fce2 /src
parentd5d09a5041a93e8b387e0dc2d5d8ace18a2adf25 (diff)
small tweaks
Diffstat (limited to 'src')
-rw-r--r--src/parcom.cr10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/parcom.cr b/src/parcom.cr
index 0f907c4..9063bf9 100644
--- a/src/parcom.cr
+++ b/src/parcom.cr
@@ -4,7 +4,7 @@ module Parcom
class ParserException < Exception
end
- class Result(T, V)
+ struct Result(T, V)
getter tokens, value
def initialize(@tokens : Array(T), @value : V)
@@ -97,11 +97,9 @@ module Parcom
end
def parse(tokens : Array(T)) : Result(T, V)
- begin
- @p1.parse(tokens)
- rescue ParserException
- @p2.parse(tokens)
- end
+ @p1.parse(tokens)
+ rescue ParserException
+ @p2.parse(tokens)
end
end
end