kaleidawave / prism

(No longer in development). Experimental compiler for building isomorphic web applications with web components.
MIT License
110 stars 1 forks source link

Literal types being interpreted as actual type #1

Closed kaleidawave closed 4 years ago

kaleidawave commented 4 years ago

Currently chef interprets literal types as being actual types.

> const bDeclaration = VariableDeclaration.fromString(`const b: "abc" = "abc";`);
> bDeclartion
> TypeSignature { name: "abc" }

Which causes them to be rendered without quotations:

> bDeclaration.render(getSettings({scriptLanguage: ScriptLanguages.Typescript}))
> const b: abc = "abc";

Literal types (strings, numbers and booleans) should be recognised in TypeSignature as a Value and parsed accordingly