Fix fromPtr; avoid warnings
This commit is contained in:
parent
d91924c72b
commit
4434f712b6
|
@ -1,7 +1,7 @@
|
|||
import { Annotated, Bytes, Dictionary, Fold, fold, Record, stringify, Tuple, Value } from "@preserves/core";
|
||||
import { stringify } from "@preserves/core";
|
||||
import * as M from "./meta";
|
||||
import { CompilerOptions, ModuleContext } from "./compiler/context";
|
||||
import { block, brackets, Formatter, Item, parens, seq } from "./compiler/block";
|
||||
import { Formatter, block, seq } from "./compiler/block";
|
||||
import { typeForDefinition } from "./compiler/gentype";
|
||||
import { converterForDefinition, converterForSimple } from "./compiler/genconverter";
|
||||
import { EMPTY_TYPE, renderType } from "./compiler/type";
|
||||
|
@ -70,8 +70,8 @@ export function compile(env: M.Environment, schema: M.Schema, options: CompilerO
|
|||
|
||||
mod.defineFunction(ctx =>
|
||||
seq(`export function from${name.description!}`,
|
||||
'(v: ', name.description!, '): _val ',
|
||||
ctx.block(() => unconverterForDefinition(ctx, name.description!, def, 'v'))));
|
||||
'(_v: ', name.description!, '): _val ',
|
||||
ctx.block(() => unconverterForDefinition(ctx, name.description!, def, '_v'))));
|
||||
}
|
||||
|
||||
const f = new Formatter();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { SchemaSyntaxError } from '../error';
|
||||
import { refPosition } from '../reader';
|
||||
import * as M from '../meta';
|
||||
import { block, brackets, formatItems, Item, parens, seq } from './block';
|
||||
|
@ -98,7 +97,7 @@ function unconverterFor(ctx: FunctionContext, p: M.Pattern, src: string, t: Simp
|
|||
case 'lit':
|
||||
return ctx.mod.literal(p.value);
|
||||
case 'pointer':
|
||||
return `_fromPtr(${src})`;
|
||||
return `${src}`;
|
||||
case 'Ref':
|
||||
return M.lookup(
|
||||
refPosition(p.value), p.value, ctx.mod.env,
|
||||
|
|
Loading…
Reference in New Issue