aiken-lang 1.1.23

Cardano smart contract language and toolchain
Documentation
---
source: crates/aiken-lang/src/parser/pattern/bytearray.rs
description: "Code:\n\nwhen foo is {\n    #\"00abcd\" -> True\n    \"Aiken, rocks!\" -> True\n    #[1, 2, 3, 4] -> True\n    #[0x00, 0xab, 0xcd] -> True\n    _ -> False\n}\n"
---
When {
    location: 0..138,
    subject: Var {
        location: 5..8,
        name: "foo",
    },
    clauses: [
        UntypedClause {
            location: 18..35,
            patterns: [
                ByteArray {
                    location: 18..27,
                    value: [
                        (
                            0,
                            0..0,
                        ),
                        (
                            171,
                            0..0,
                        ),
                        (
                            205,
                            0..0,
                        ),
                    ],
                    preferred_format: HexadecimalString,
                },
            ],
            then: Var {
                location: 31..35,
                name: "True",
            },
        },
        UntypedClause {
            location: 40..63,
            patterns: [
                ByteArray {
                    location: 40..55,
                    value: [
                        (
                            65,
                            0..0,
                        ),
                        (
                            105,
                            0..0,
                        ),
                        (
                            107,
                            0..0,
                        ),
                        (
                            101,
                            0..0,
                        ),
                        (
                            110,
                            0..0,
                        ),
                        (
                            44,
                            0..0,
                        ),
                        (
                            32,
                            0..0,
                        ),
                        (
                            114,
                            0..0,
                        ),
                        (
                            111,
                            0..0,
                        ),
                        (
                            99,
                            0..0,
                        ),
                        (
                            107,
                            0..0,
                        ),
                        (
                            115,
                            0..0,
                        ),
                        (
                            33,
                            0..0,
                        ),
                    ],
                    preferred_format: Utf8String,
                },
            ],
            then: Var {
                location: 59..63,
                name: "True",
            },
        },
        UntypedClause {
            location: 68..89,
            patterns: [
                ByteArray {
                    location: 68..81,
                    value: [
                        (
                            1,
                            70..71,
                        ),
                        (
                            2,
                            73..74,
                        ),
                        (
                            3,
                            76..77,
                        ),
                        (
                            4,
                            79..80,
                        ),
                    ],
                    preferred_format: ArrayOfBytes(
                        Decimal {
                            numeric_underscore: false,
                        },
                    ),
                },
            ],
            then: Var {
                location: 85..89,
                name: "True",
            },
        },
        UntypedClause {
            location: 94..121,
            patterns: [
                ByteArray {
                    location: 94..113,
                    value: [
                        (
                            0,
                            96..100,
                        ),
                        (
                            171,
                            102..106,
                        ),
                        (
                            205,
                            108..112,
                        ),
                    ],
                    preferred_format: ArrayOfBytes(
                        Hexadecimal,
                    ),
                },
            ],
            then: Var {
                location: 117..121,
                name: "True",
            },
        },
        UntypedClause {
            location: 126..136,
            patterns: [
                Discard {
                    name: "_",
                    location: 126..127,
                },
            ],
            then: Var {
                location: 131..136,
                name: "False",
            },
        },
    ],
}