Giter Club home page Giter Club logo

stoa's Introduction

Project Stoa

Project Status

[ ] create an example language based on Crafting Interpreters called Stox

[ ] create a malleable language framework for exploring language ideas

Example Languages

Stox

Code Structure

make graphics

./images/stox-code.png

Build Status

make clean all
rm -rf node_modules
rm -rf coverage
rm -f ./bin/stox.js
pnpm install
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
Packages: +305
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 305, reused 305, downloaded 0, added 296
Progress: resolved 305, reused 305, downloaded 0, added 305, done

devDependencies:
+ @istanbuljs/nyc-config-typescript 1.0.2
+ @types/node 14.18.63
+ dependency-cruiser 11.18.0
+ nodemon 2.0.22
+ nyc 15.1.0
+ opts 2.0.2
+ tsup 6.7.0
+ typescript 4.9.5

Done in 1.8s
CLI Building entry: lib/repl-kit/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v6.7.0
CLI Target: es6
CJS Build start
CJS packages/repl-kit/index.js     5.13 KB
CJS packages/repl-kit/index.js.map 13.73 KB
CJS ⚡️ Build success in 229ms
DTS Build start
DTS ⚡️ Build success in 622ms
DTS packages/repl-kit/index.d.ts 228.00 B
CLI Building entry: stox.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v6.7.0
CLI Target: es6
CJS Build start
CJS bin/stox.js     29.19 KB
CJS bin/stox.js.map 118.16 KB
CJS ⚡️ Build success in 20ms

Usage Documentation

./bin/stox --help
Usage: node ./bin/stox.js [options] [file]
Show this help message
    --help
prints version info and exits
    -v, --version
prints parse tree and exits
    -p, --parse
prints tokens and exits
    -t, --tokens
runs the repl
    -r, --repl

Current Version

./bin/stox -v
stox-2022.08.15

Code Coverage

make coverage
=============================== Coverage summary ===============================
Statements   : 95.53% ( 813/851 )
Branches     : 80.4% ( 357/444 )
Functions    : 97.76% ( 219/224 )
Lines        : 95.44% ( 713/747 )
================================================================================
------------------|---------|----------|---------|---------|----------------------------------------
File              | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------|---------|----------|---------|---------|----------------------------------------
All files         |   95.53 |     80.4 |   97.76 |   95.44 |
 lib/stoa-ltk     |   98.33 |    92.07 |   95.74 |    98.1 |
  language.ts     |     100 |    95.23 |     100 |     100 | 60
  parser.ts       |   95.23 |       75 |   84.61 |   94.28 | 13,84
  reporter.ts     |     100 |      100 |     100 |     100 |
  runtime.ts      |     100 |      100 |     100 |     100 |
  tokenizer.ts    |   98.82 |    98.14 |     100 |   98.63 | 216
 stox             |   94.01 |    75.42 |   99.23 |   94.38 |
  cli-app.ts      |     100 |       80 |     100 |     100 | 34-39
  interpreter.ts  |   90.06 |     75.7 |     100 |   90.44 | ...108,124-126,157,168,229,244,253,255
  parser.ts       |   93.68 |    73.04 |   97.14 |   94.47 | 16,56,180-181,272,375,463,469-481
  printer.ts      |   96.87 |       80 |     100 |   96.42 | 55-56
  resolver.ts     |     100 |       85 |     100 |     100 | 46,123,166
  stox-lang.ts    |     100 |      100 |     100 |     100 |
  tokenizer.ts    |     100 |      100 |     100 |     100 |
 stox/ast         |     100 |      100 |     100 |     100 |
  declarations.ts |     100 |      100 |     100 |     100 |
  expressions.ts  |     100 |      100 |     100 |     100 |
  nodes.ts        |     100 |      100 |     100 |     100 |
  statements.ts   |     100 |      100 |     100 |     100 |
  visitor.ts      |     100 |      100 |     100 |     100 |
 stox/runtime     |    92.3 |     82.5 |    90.9 |   89.79 |
  classes.ts      |      90 |       75 |    87.5 |    87.5 | 19,32
  control-flow.ts |     100 |       75 |     100 |     100 | 7
  environment.ts  |      90 |    82.14 |     100 |   84.61 | 17,23
  globals.ts      |   66.66 |      100 |      50 |   66.66 | 7
  values.ts       |     100 |      100 |     100 |     100 |
------------------|---------|----------|---------|---------|----------------------------------------

The latest uploaded code-coverage reports are at: https://khtdr.com/stoa/coverage

Test Suite Status

make test
Testing: arithmetic.stox
✔✔✔✔✔✔
Testing: bad-token.stox
✔✔✔✔✔✔
Testing: class-syntax.stox
✔✔✔✔✔✔
Testing: closures.stox
✔✔✔✔✔✔
Testing: comments.stox
✔✔✔✔✔✔
Testing: divide-by-zero.stox
✔✔✔✔✔✔
Testing: fib.stox
✔✔✔✔✔✔
Testing: functions.stox
✔✔✔✔✔✔
Testing: global-redefine.stox
✔✔✔✔✔✔
Testing: hello-world.stox
✔✔✔✔✔✔
Testing: literals.stox
✔✔✔✔✔✔
Testing: logical-ternary.stox
✔✔✔✔✔✔
Testing: name.stox
✔✔✔✔✔✔
Testing: same-names.stox
✔✔✔✔✔✔
Testing: scope.stox
✔✔✔✔✔✔
Testing: semantic-return.stox
✔✔✔✔✔✔
Testing: sticky-precision.stox
✔✔✔✔✔✔
Testing: triforce.stox
✔✔✔✔✔✔
Testing: version.stox
✔✔✔✔✔✔

Passing: 114 out of 114 (100%)
Failing: 0 out of 114 (0%)

Potential Goals

  • full stack from sql to hover effects
  • lsp compatible
  • actually use it to create
  • minimize user function writing with string/date/number primitives

clean

src_elisp[:results none]{(save-excursion (org-goto-line 1) (+org/remove-result-blocks t))}

build

src_elisp[:results none]{(save-excursion (org-goto-line 1) (org-babel-execute-subtree))}

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.