Comparing version 1.2.5 to 1.3.0
@@ -18,3 +18,3 @@ module.exports = { | ||
}, | ||
ignorePatterns: ['.eslintrc.js', 'lib/**'], | ||
ignorePatterns: ['.eslintrc.js', 'lib/**', 'src/generated/**'], | ||
rules: { | ||
@@ -21,0 +21,0 @@ '@typescript-eslint/interface-name-prefix': 'off', |
@@ -5,4 +5,9 @@ # Release notes | ||
## 1.3.0 | ||
- Parser implemented using ANTLR in files MathJSLabLexer.g4 and MathJSLabParser.g4. The wrapper class for lexer and parser has been created in file Parser.ts. Need to make extensive tests. | ||
- File names converted to camel case. | ||
- The file AST.ts (Abstract Syntax Tree) has been created, and related types and interfaces defined in Evaluator.ts has been moved to AST.ts file. | ||
## 1.2.5 | ||
- Optimizations (resulting return as number) and code cleaning by hand in file 'parser.jison'. | ||
- Optimizations (resulting return as number) in multi-array.ts file and code cleaning by hand in file 'parser.jison'. | ||
@@ -9,0 +14,0 @@ ## 1.2.4 |
@@ -103,18 +103,4 @@ # Contributing to MathJSLab | ||
* String type and their respective functions. | ||
* Parser is designed to scan a line (now support spaces and newlines | ||
inside block comments and arrays). Need to code a parser that scan | ||
multiple lines calling Evaluator when need. | ||
The real need is a parser that supports both modes: single-line and | ||
multi-line. | ||
* More extensive tests need to be written, especially to test the parser and | ||
evaluator. | ||
* Search for other compiler-compiler tools besides | ||
[Jison](https://gerhobbelt.github.io/jison/), for use in the project. | ||
[Jison](https://gerhobbelt.github.io/jison/) has many limitations and the | ||
generated parser is not suitable for compiling together with | ||
[ES6](https://262.ecma-international.org/6.0/) modules written in | ||
[Typescript](https://www.typescriptlang.org/). This is the reason why | ||
MathJSLab is compiled as an ES5 module. At now we are developing a parser | ||
using ANTLR4 and version 1.2.5 is probably the last version of MathJSLab | ||
using Jison. | ||
@@ -121,0 +107,0 @@ You are welcome to contribute to this project. I will be very grateful if you |
@@ -1,10 +0,12 @@ | ||
export { CharString } from './char-string'; | ||
export { CharString } from './CharString'; | ||
export { Decimal } from 'decimal.js'; | ||
export { ComplexDecimal } from './complex-decimal'; | ||
export { MultiArray } from './multi-array'; | ||
export { CoreFunctions } from './core-functions'; | ||
export { LinearAlgebra } from './linear-algebra'; | ||
export { MathObject } from './math-object'; | ||
export { Configuration } from './configuration'; | ||
export { SymbolTable } from './symbol-table'; | ||
export { Evaluator } from './evaluator'; | ||
export { ComplexDecimal } from './ComplexDecimal'; | ||
export { MultiArray } from './MultiArray'; | ||
export { CoreFunctions } from './CoreFunctions'; | ||
export { LinearAlgebra } from './LinearAlgebra'; | ||
export { MathObject } from './MathObject'; | ||
export { Configuration } from './Configuration'; | ||
export { SymbolTable } from './SymbolTable'; | ||
export * as AST from './AST'; | ||
export { Parser } from './Parser'; | ||
export { Evaluator } from './Evaluator'; |
{ | ||
"name": "mathjslab", | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"description": "MathJSLab - An interpreter with language syntax like MATLAB®/Octave. ISBN 978-65-00-82338-7", | ||
@@ -25,3 +25,3 @@ "main": "lib/mathjslab.js", | ||
"flex", | ||
"jison" | ||
"ANTLR" | ||
], | ||
@@ -35,3 +35,5 @@ "author": "Sergio Lindau <sergiolindau@gmail.com>", | ||
"scripts": { | ||
"clean": "rimraf lib src/parser.js", | ||
"clean:generated": "rimraf ./src/.antlr ./src/MathJSLabLexer.ts ./src/MathJSLabLexer.tokens ./src/MathJSLabLexer.interp ./src/MathJSLabParser.ts ./src/MathJSLabParser.tokens ./src/MathJSLabParser.interp ./src/MathJSLabParserVisitor.ts", | ||
"clean": "rimraf lib && npm run clean:generated", | ||
"clean:antlr:tokens:interp": "rimraf ./src/.antlr ./src/MathJSLabParser.tokens ./src/MathJSLabParser.interp ./src/MathJSLabLexer.tokens ./src/MathJSLabLexer.interp", | ||
"update": "npx ncu -u && npm install", | ||
@@ -50,4 +52,3 @@ "git:add": "git add .", | ||
"test:watch": "jest --watch", | ||
"prebuild:parser": "rimraf src/parser.js", | ||
"build:parser": "jison src/parser.jison -o src/parser.js", | ||
"build:parser": "java org.antlr.v4.Tool ./src/MathJSLabLexer.g4 ./src/MathJSLabParser.g4 -Dlanguage=TypeScript -no-visitor -no-listener -o ./src/ && npm run clean:antlr:tokens:interp", | ||
"prebuild": "npm run build:parser", | ||
@@ -58,2 +59,3 @@ "build": "webpack --mode production", | ||
"dependencies": { | ||
"antlr4": "^4.13.1-patch-1", | ||
"decimal.js": "^10.4.3" | ||
@@ -63,7 +65,7 @@ }, | ||
"@types/debug": "^4.1.12", | ||
"@types/jest": "29.5.10", | ||
"@types/node": "^20.10.2", | ||
"@types/jest": "29.5.11", | ||
"@types/node": "^20.10.4", | ||
"@types/supertest": "^2.0.16", | ||
"@types/webpack": "^5.28.5", | ||
"@typescript-eslint/eslint-plugin": "^6.13.1", | ||
"@typescript-eslint/eslint-plugin": "^6.13.2", | ||
"eslint": "^8.55.0", | ||
@@ -74,4 +76,3 @@ "eslint-config-prettier": "^9.1.0", | ||
"jest": "29.7.0", | ||
"jison": "^0.4.18", | ||
"lint-staged": "^15.1.0", | ||
"lint-staged": "^15.2.0", | ||
"prettier": "^3.1.0", | ||
@@ -81,4 +82,4 @@ "rimraf": "^5.0.5", | ||
"ts-loader": "^9.5.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.3.2", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.3.3", | ||
"webpack": "^5.89.0", | ||
@@ -85,0 +86,0 @@ "webpack-cli": "^5.1.4" |
@@ -18,3 +18,3 @@ # MathJSLab | ||
It uses the [Jison](https://gerhobbelt.github.io/jison/) | ||
It uses the [ANTLR](https://www.antlr.org/) | ||
[parser generator](https://en.wikipedia.org/wiki/Compiler-compiler) to | ||
@@ -49,3 +49,3 @@ generate a [parser](https://en.wikipedia.org/wiki/Parsing) that create an | ||
MathJSLab works on any [ES5](https://www.ecma-international.org/wp-content/uploads/ECMA-262_5th_edition_december_2009.pdf) compatible | ||
MathJSLab works on any [ES2016](https://262.ecma-international.org/7.0/) compatible | ||
[JavaScript](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) | ||
@@ -52,0 +52,0 @@ engine, including [Node.js](https://nodejs.org/), |
@@ -1,10 +0,12 @@ | ||
export { CharString } from './char-string'; | ||
export { CharString } from './CharString'; | ||
export { Decimal } from 'decimal.js'; | ||
export { ComplexDecimal } from './complex-decimal'; | ||
export { MultiArray } from './multi-array'; | ||
export { CoreFunctions } from './core-functions'; | ||
export { LinearAlgebra } from './linear-algebra'; | ||
export { MathObject } from './math-object'; | ||
export { Configuration } from './configuration'; | ||
export { SymbolTable } from './symbol-table'; | ||
export { Evaluator } from './evaluator'; | ||
export { ComplexDecimal } from './ComplexDecimal'; | ||
export { MultiArray } from './MultiArray'; | ||
export { CoreFunctions } from './CoreFunctions'; | ||
export { LinearAlgebra } from './LinearAlgebra'; | ||
export { MathObject } from './MathObject'; | ||
export { Configuration } from './Configuration'; | ||
export { SymbolTable } from './SymbolTable'; | ||
export * as AST from './AST'; | ||
export { Parser } from './Parser'; | ||
export { Evaluator } from './Evaluator'; |
@@ -14,3 +14,3 @@ { | ||
/* Language and Environment */ | ||
"target": "es5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ | ||
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ | ||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ | ||
@@ -17,0 +17,0 @@ // "jsx": "react", /* Specify what JSX code is generated. */ |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
772728
20
59
9597
2
1
+ Addedantlr4@^4.13.1-patch-1
+ Addedantlr4@4.13.2(transitive)