Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiolindau committed Sep 30, 2023
1 parent 18e9b2d commit 4c6eb6d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# MathJSLab

> An interpreter with language syntax like MATLAB®/Octave written in TypeScript.
> An interpreter with language syntax like [MATLAB®](https://www.mathworks.com/)/[Octave](https://www.gnu.org/software/octave/) written in [Typescript](https://www.typescriptlang.org/).
This package emulates a parser and evaluator for a subset of
[MATLAB®](https://www.mathworks.com/)/[Octave](https://www.gnu.org/software/octave/)
language written completely in [Typescript](https://www.typescriptlang.org/).

It can run in browser environment and implements an arbitrary precision
arithmetics using [decimal.js](https://www.npmjs.com/package/decimal.js)
package.

It uses the [Jison](https://gerhobbelt.github.io/jison/)
[parser generator](https://en.wikipedia.org/wiki/Compiler-compiler) to create an
[parser generator](https://en.wikipedia.org/wiki/Compiler-compiler) to
generate a [parser](https://en.wikipedia.org/wiki/Parsing) that create an
[AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
([Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)).
([Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)) of input.

It can run in browser environment and implements an arbitrary precision arithmetics using
[decimal.js](https://www.npmjs.com/package/decimal.js) package. MathJSLab
has functions to generate [MathML](https://www.w3.org/Math/) code of
expressions parsed too.
Other components besides the [parser](https://en.wikipedia.org/wiki/Parsing)
are the evaluator and the [MathML](https://www.w3.org/Math/) unparser, which
computes the inputs and generates mathematical representations of the inputs
and results, respectively.

This software is intended for educational purposes, to provide teachers and
students with a computer aided calculation tool that is capable of running in
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mathjslab",
"version": "1.0.20",
"version": "1.0.21",
"description": "MathJSLab - An interpreter with language syntax like MATLAB/Octave",
"main": "build/mathjslab.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -55,7 +55,7 @@
"devDependencies": {
"@types/debug": "^4.1.9",
"@types/jest": "29.5.5",
"@types/node": "^20.7.1",
"@types/node": "^20.7.2",
"@types/supertest": "^2.0.13",
"@types/webpack": "^5.28.3",
"@typescript-eslint/eslint-plugin": "^6.7.3",
Expand Down
2 changes: 0 additions & 2 deletions src/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ export class Evaluator {
global.EvaluatorPointer = this;
this.exitStatus = Evaluator.response.OK;
/* Set opTable aliases */
this.opTable['.+'] = this.opTable['+'];
this.opTable['.-'] = this.opTable['-'];
this.opTable['**'] = this.opTable['^'];
this.opTable['.**'] = this.opTable['.^'];
this.opTable['~='] = this.opTable['!='];
Expand Down

0 comments on commit 4c6eb6d

Please sign in to comment.