# Snapshot report for `src/utils/__tests__/print-node-spec.js`

The actual snapshot is saved in `print-node-spec.js.snap`.

Generated by [AVA](https://ava.li).

## assignment, ternary, if

> Snapshot 1

    `(local x i32                              ; mutable␊
      (i32.const 0)                           ;␊
    )                                         ;␊
    (export                                   ;␊
      (func test param(z i32) (result i32)    ;␊
        (local y i32                          ; mutable␊
          (select                             ;␊
            (i32.const 1)                     ;␊
            (i32.const 0)                     ;␊
            (i32.gt_s                         ;␊
              (get_local z)                   ;␊
              (i32.const 0)                   ;␊
            )                                 ;␊
          )                                   ;␊
        )                                     ;␊
        (if                                   ;␊
          (i32.eq                             ;␊
            (get_local z)                     ;␊
            (i32.const 2)                     ;␊
          )                                   ;␊
          (then                               ;␊
            (set_global x                     ;␊
              (i32.const 2)                   ;␊
            )                                 ;␊
          )                                   ;␊
          (else                               ;␊
            (set_global x                     ;␊
              (i32.const 1)                   ;␊
            )                                 ;␊
          )                                   ;␊
        )                                     ;␊
        (set_local y                          ;␊
          (i32.add                            ;␊
            (i32.const 1)                     ;␊
            (i32.const 1)                     ;␊
          )                                   ;␊
        )                                     ;␊
        (return                               ;␊
          (i32.add                            ;␊
            (get_global x)                    ;␊
            (get_local y)                     ;␊
          )                                   ;␊
        )                                     ;␊
      )                                       ;␊
    )                                         ;␊
    `

## full ast printer

> Snapshot 1

    `(func simple (result i32)                              ;␊
      (local x i32                                         ; immutable␊
        (i32.add                                           ;␊
          (i32.const 1)                                    ;␊
          (i32.const 1)                                    ;␊
        )                                                  ;␊
      )                                                    ;␊
      (local y i32                                         ; immutable␊
        (i32.const 2)                                      ;␊
      )                                                    ;␊
      (return                                              ;␊
        (i32.add                                           ;␊
          (get_local x)                                    ;␊
          (get_local y)                                    ;␊
        )                                                  ;␊
      )                                                    ;␊
    )                                                      ;␊
    (func multiple_args param(x i32 y f32) (result f32)    ;␊
      (return                                              ;␊
        (f32.add                                           ;␊
          (f32.convert_s/i32                               ;␊
            (get_local x)                                  ;␊
          )                                                ;␊
          (get_local y)                                    ;␊
        )                                                  ;␊
      )                                                    ;␊
    )                                                      ;␊
    (func arrays (result i32)                              ;␊
      (local x i32                                         ; immutable␊
        (i32[].const 0)                                    ;␊
      )                                                    ;␊
      (i32.store                                           ;␊
        (i32.load                                          ;␊
          (get_local x)                                    ;␊
          (i32.const 0)                                    ;␊
        )                                                  ;␊
        (i32.const 2)                                      ;␊
      )                                                    ;␊
      (i32.store                                           ;␊
        (i32.load                                          ;␊
          (get_local x)                                    ;␊
          (i32.const 1)                                    ;␊
        )                                                  ;␊
        (i32.const 2)                                      ;␊
      )                                                    ;␊
      (return                                              ;␊
        (i32.add                                           ;␊
          (i32.load                                        ;␊
            (get_local x)                                  ;␊
            (i32.const 0)                                  ;␊
          )                                                ;␊
          (i32.load                                        ;␊
            (get_local x)                                  ;␊
            (i32.const 1)                                  ;␊
          )                                                ;␊
        )                                                  ;␊
      )                                                    ;␊
    )                                                      ;␊
    `

## imports/exports

> Snapshot 1

    `(import "env" "foo" (type FooType (func (result i32))))    ;␊
    (import "env" "bar" (type FooType (func (result i32))))    ;␊
    (type FooType (func (result i32)))                         ;␊
    (func two (result i32)                                     ;␊
      (return                                                  ;␊
        (i32.const 2)                                          ;␊
      )                                                        ;␊
    )                                                          ;␊
    (export                                                    ;␊
      (func test (result i32)                                  ;␊
        (return                                                ;␊
          (call foo                                            ;␊
            (i32.add                                           ;␊
              (call two)                                       ;␊
              (i32.const 2)                                    ;␊
            )                                                  ;␊
          )                                                    ;␊
        )                                                      ;␊
      )                                                        ;␊
    )                                                          ;␊
    `

## plain ast parser

> Snapshot 1

    `(type Type (func param(i32 f32) (result i32)))    ;␊
    (type-generic Inc)                                ; pseudo type␊
    (func simple param(y i32) (result i32)            ;␊
      (local x i32                                    ; immutable␊
        (i32.const 2)                                 ;␊
      )                                               ;␊
      (return                                         ;␊
        (??.add                                       ;␊
          (get_local x)                               ;␊
          (get_local y)                               ;␊
        )                                             ;␊
      )                                               ;␊
    )                                                 ;␊
    `
