chore: Set up development environment
Add the civet and typescript compilers, implement a build step, provide examples of using from es6, script, and command line. Of course, there is no actual behavior produced; convert always produces 'foo' at the moment.
This commit is contained in:
parent
26f1be2d67
commit
67a07e2000
10 changed files with 468 additions and 1 deletions
2
src/example.civet
Normal file
2
src/example.civet
Normal file
|
@ -0,0 +1,2 @@
|
|||
{convert} from ./index.js
|
||||
console.log convert 'bar'
|
14
src/index.civet
Normal file
14
src/index.civet
Normal file
|
@ -0,0 +1,14 @@
|
|||
type Tree = {[key:string]: string | Tree}
|
||||
|
||||
export function tree97(vrml1: string): Tree
|
||||
{converted: 'foo'}
|
||||
|
||||
function render(t: string | Tree): string
|
||||
if typeof t is 'string'
|
||||
return t
|
||||
if result := t.converted
|
||||
render result
|
||||
else '<Conversion failed>'
|
||||
|
||||
export function convert(vrml1: string): string
|
||||
render tree97 vrml1
|
Loading…
Add table
Add a link
Reference in a new issue