aboutsummaryrefslogtreecommitdiff
path: root/src/parcom.cr
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-11 15:28:48 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-11 15:28:48 +1300
commit86018a99ae80fe657123ad96d52317ede660edd1 (patch)
tree431de3e028e9416eb0874b34f120d07396b432cc /src/parcom.cr
parent9951495a7b897b167a86c1c656b4f2418fd44e96 (diff)
Documentation for struct Result
Diffstat (limited to 'src/parcom.cr')
-rw-r--r--src/parcom.cr5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parcom.cr b/src/parcom.cr
index 50f6e7e..028f596 100644
--- a/src/parcom.cr
+++ b/src/parcom.cr
@@ -69,6 +69,11 @@ module Parcom
end
end
+ # A `Result` stores a `Tokens` object and a parsed value,
+ # and is effectively used to store the state of a parser chain.
+ # This is used instead of a `Tuple` or `NamedTuple` because:
+ # 1. This is more idiomatic than a `Tuple`.
+ # 2. Crystal does not support generic named tuples.
struct Result(T, V)
getter tokens, value