Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "solregex", | ||
"version": "0.1.1", | ||
"description": "solidity regex library", | ||
"version": "0.1.2", | ||
"description": "generates Solidity smart contracts to match regular expressions", | ||
"author": "g. nicholas d'andrea <nick@gnidan.org>", | ||
"license": "MIT", | ||
"bin": { | ||
"solregex": "index.js" | ||
"solregex": "dist/main.bundle.js" | ||
}, | ||
"dependencies": { | ||
"scripts": { | ||
"lint": "eslint ./src", | ||
"compile": "webpack", | ||
"prepublish": "webpack -p", | ||
"clean": "rm -rf ./dist" | ||
}, | ||
"keywords": [ | ||
"solidity", | ||
"regex", | ||
"ethereum" | ||
], | ||
"devDependencies": { | ||
"argparse": "^1.0.9", | ||
"automata.js": "^0.2.1" | ||
} | ||
"automata.js": "^0.2.1", | ||
"babel-core": "^6.25.0", | ||
"babel-loader": "^7.0.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-runtime": "^6.23.0", | ||
"eslint": "^3.0.0", | ||
"eslint-loader": "^1.7.1", | ||
"webpack": "^2.6.1", | ||
"webpack-dev-server": "2" | ||
}, | ||
"repository": "git@github.com:gnidan/solregex.git" | ||
} |
@@ -1,14 +0,52 @@ | ||
Regexes in Solidity | ||
=================== | ||
solregex | ||
======== | ||
Simple regular expression matcher contract generation for Solidity. | ||
Tool to generate a Solidity smart contract for a given regular expression. | ||
Generates Solidity smart contract source file matching a particular regular | ||
expression. | ||
Uses [Automata.js](https://github.com/hokein/Automata.js), limited by | ||
Automata's support for regex components: | ||
Install | ||
------- | ||
> Currently, Automata.js supports minimal regular expressions: | ||
``` | ||
npm install -g solregex | ||
``` | ||
Usage | ||
----- | ||
``` | ||
$ solregex --name BasicRegex 'a+(ab)*b+' > ./contracts/BasicRegex.sol | ||
``` | ||
Status / Motivation | ||
------------------- | ||
**Proof-of-concept** currently. | ||
This project is probably not currently useful for most regexes you'd want. | ||
Some limitations: | ||
- Extremely limited syntax. Does not support `.` or `[]` currently, let alone | ||
backreferences, etc. | ||
- Very bad performance for everything but the most simple regular expressions. | ||
**Why?** | ||
Hopefully to inspire additional work on the problem. It'd be nice to have | ||
performant regexes on the EVM, with the usual modern regex bells and whistles. | ||
This project currently uses [Automata.js](https://github.com/hokein/Automata.js) | ||
for regex parsing and state machine descriptions. | ||
Currently, this takes a very naïve approach with basically everything, so as to | ||
quickly achieve minimal matching functionality. My hope is that it should be | ||
fairly straightforward to apply some simple, known techniques in order to | ||
produce a more robust / gas-efficient implementation. | ||
Supported Syntax | ||
---------------- | ||
From Automata.js: | ||
> * `+`: One or more | ||
@@ -25,14 +63,1 @@ > * `*`: Zero | ||
Install | ||
------- | ||
``` | ||
npm install -g solregex | ||
``` | ||
Usage | ||
----- | ||
``` | ||
$ solregex --name BasicRegex 'a+(ab)*b+' > ./contracts/BasicRegex.sol | ||
``` |
Sorry, the diff of this file is not supported yet
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
135743
0
447
63
11
9
1
- Removedargparse@^1.0.9
- Removedautomata.js@^0.2.1
- Removedargparse@1.0.10(transitive)
- Removedautomata.js@0.2.1(transitive)
- Removedsprintf-js@1.0.3(transitive)