TreeSitterWasmError.fromNative constructor

TreeSitterWasmError.fromNative(
  1. TreeSitterNativeWasmError error
)

Implementation

factory TreeSitterWasmError.fromNative(TreeSitterNativeWasmError error) =>
    TreeSitterWasmError(switch (error.kind) {
      TreeSitterNativeWasmErrorKind.parse => TreeSitterWasmErrorKind.parse,
      TreeSitterNativeWasmErrorKind.compile =>
        TreeSitterWasmErrorKind.compile,
      TreeSitterNativeWasmErrorKind.instantiate =>
        TreeSitterWasmErrorKind.instantiate,
      TreeSitterNativeWasmErrorKind.none ||
      TreeSitterNativeWasmErrorKind.allocate => TreeSitterWasmErrorKind.other,
    }, error.message);