Coder Social home page Coder Social logo

kylejlin / tyson Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 1.07 MB

A tool that generates a TypeScript file from your Jison grammar's semantic actions so you can typecheck those semantic actions

Home Page: https://www.npmjs.com/package/tyson

License: MIT License

JavaScript 21.18% TypeScript 78.82%

tyson's People

Contributors

kylejlin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

tyson's Issues

Can't install v1.5.0

When I try to install v1.5.0, this happens:

kyles-mbp:sandc kyle$ npm install --save-dev tyson
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /Users/kyle/sand-lang/sandc/node_modules/tyson/dist/cli.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/kyle/sand-lang/sandc/node_modules/tyson/dist/cli.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

Empty production rule leads to an argument of type `TysonTypeDictionary[""]` being emitted

Expected behavior:

const semanticActions = {
  "optPackageStatement -> "(): TysonTypeDict["optPackageStatement"] {
    let $$: TysonTypeDict["optPackageStatement"];
    // ...
    return $$;
  },
};

Actual behavior:

const semanticActions = {
  "optPackageStatement -> "(
    $1: TysonTypeDict[""],
  ): TysonTypeDict["optPackageStatement"] {
    let $$: TysonTypeDict["optPackageStatement"];
    // ...
    return $$;
  },
};

types in moduleIncludes block

[#6] includes the %{...%} code block into the generated TS file. This is fine for constants but problematic for code that needs typing because jison's output isn't typescript-friendly. I'm tooling away on this now.

`--type-dict-interface` flag not recognized

I ran the following command:

tyson grammar/sand.jison src/interfaces/tysonTypeDict.ts --type-dict-interface TysonTypeDict --out src/parser/semanticActions.generated.ts

Expected behavior:

I would expect Tyson to generate a TypeScript file as intended.

Actual behavior:

I got the following error:

Expecting a file with one of the following extensions: [".jison", ".ts"], but received "--type-dict-interface".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.