mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Fix code guards
This commit is contained in:
parent
5069d926bb
commit
db3698c33c
2 changed files with 8 additions and 0 deletions
|
@ -21,10 +21,13 @@ use super::wrap_in_decode_custom_decode_with;
|
|||
|
||||
/// Implements decoding of a tuple. For example, for
|
||||
///
|
||||
/// ```text
|
||||
/// (a, b)
|
||||
/// ```
|
||||
///
|
||||
/// we'd like to generate an impl like
|
||||
///
|
||||
/// ```roc
|
||||
/// decoder : Decoder (a, b) fmt | a has Decoding, b has Decoding, fmt has DecoderFormatting
|
||||
/// decoder =
|
||||
/// initialState : {e0: Result a [NoElem], e1: Result b [NoElem]}
|
||||
|
@ -53,6 +56,7 @@ use super::wrap_in_decode_custom_decode_with;
|
|||
/// Err NoElem -> Err TooShort
|
||||
///
|
||||
/// Decode.custom \bytes, fmt -> Decode.decodeWith bytes (Decode.tuple initialState stepElem finalizer) fmt
|
||||
/// ```
|
||||
pub(crate) fn decoder(env: &mut Env, _def_symbol: Symbol, arity: u32) -> (Expr, Variable) {
|
||||
// The decoded type of each index in the tuple, e.g. (a, b).
|
||||
let mut index_vars = Vec::with_capacity(arity as _);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue