Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ Inputs to improvement? [Open an issue](https://github.com/agershun/alasql/issues

**All contributions are much welcome and greatly appreciated(!)**

1. Fork the repo here on Github
0. Clone your forked repo and install dependencies `git clone https://github.com/MYUSERNAME/alasql/ && cd alasql && npm install`
0. Please work with the code from the develop branch `git checkout develop`
0. Add a test for the issue: Copy `test/test000.js` and replace `000` with a new number.
0. Impelement a test that reflects the issue.
0. Run `npm test` to verify only the new test fails
0. Implement your contributions in `src/`
0. Run `npm test` and verify all tests are OK
0. Commit changes to git and push to your forked repo
0. Click "Create Pull-request" when looking at your forked repo on Github
- Fork the repo here on Github
- Clone your forked repo and install dependencies `git clone https://github.com/MYUSERNAME/alasql/ && cd alasql && npm install`
- Please work with the code from the develop branch `git checkout develop`
- Add a test for the issue: Copy `test/test000.js` and replace `000` with a new number.
- Impelement a test that reflects the issue.
- Run `npm test` to verify only the new test fails
- Implement your contributions in `src/`
- Run `npm test` and verify all tests are OK
- Commit changes to git and push to your forked repo
- Click "Create Pull-request" when looking at your forked repo on Github

_Please note that `npm test` will compile from `src/` before running tests_

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ node_modules/
npm-debug.log
site/
test/test604.json
test/test251.xlsx
.versions
.npm/
34 changes: 17 additions & 17 deletions dist/alasql-echo.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Plugin sample
var yy = alasql.yy;
yy.Echo = function (params) { return yy.extend(this, params); }
yy.Echo.prototype.toString = function() {
var s = 'TEST '+this.expr.toString();
return s;
}
yy.Echo.prototype.execute = function (databaseid, params, cb) {
// var self = this;
// console.log(76336,this.expr.toJS());
var fn = new Function('params, alasql','return '+this.expr.toJS());
var res = fn(params, alasql);
if(cb) res = cb(res);
return res;
// Plugin sample

var yy = alasql.yy;

yy.Echo = function (params) { return yy.extend(this, params); }
yy.Echo.prototype.toString = function() {
var s = 'TEST '+this.expr.toString();
return s;
}

yy.Echo.prototype.execute = function (databaseid, params, cb) {
// var self = this;
// console.log(76336,this.expr.toJS());
var fn = new Function('params, alasql','return '+this.expr.toJS());
var res = fn(params, alasql);
if(cb) res = cb(res);
return res;
}
43 changes: 0 additions & 43 deletions dist/alasql-md.js

This file was deleted.

78 changes: 39 additions & 39 deletions dist/alasql-prolog.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
// Prolog plugin
var yy = alasql.yy;
yy.Term = function (params) { return yy.extend(this, params); }
yy.Term.prototype.toString = function() {
var s = this.termid;
if(this.args && this.args.length > 0) {
s += '('+this.args.map(function(arg){
return arg.toString();
})+')';
}
return s;
};
yy.AddRule = function (params) { return yy.extend(this, params); }
yy.AddRule.prototype.toString = function() {
var s = '';
if(this.left) s += this.left.toString();
s += ':-';
s += this.right.map(function(r){return r.toString()}).join(',');
return s;
};
yy.AddRule.prototype.execute = function (databaseid, params, cb) {
// var self = this;
// console.log(this.expr.toJS());
// var fn = new Function('params, alasql','return '+this.expr.toJS());
// var res = fn(params, alasql);
var res = 1;
var objects = alasql.databases[databaseid].objects;
var rule = {};
if(!this.left) {
this.right.forEach(function(term){
rule.$class = term.termid;
});
}
if(cb) res = cb(res);
return res;
// Prolog plugin

var yy = alasql.yy;

yy.Term = function (params) { return yy.extend(this, params); }
yy.Term.prototype.toString = function() {
var s = this.termid;
if(this.args && this.args.length > 0) {
s += '('+this.args.map(function(arg){
return arg.toString();
})+')';
}
return s;
};

yy.AddRule = function (params) { return yy.extend(this, params); }
yy.AddRule.prototype.toString = function() {
var s = '';
if(this.left) s += this.left.toString();
s += ':-';
s += this.right.map(function(r){return r.toString()}).join(',');
return s;
};

yy.AddRule.prototype.execute = function (databaseid, params, cb) {
// var self = this;
// console.log(this.expr.toJS());
// var fn = new Function('params, alasql','return '+this.expr.toJS());
// var res = fn(params, alasql);
var res = 1;
var objects = alasql.databases[databaseid].objects;
var rule = {};
if(!this.left) {
this.right.forEach(function(term){
rule.$class = term.termid;
});
}
if(cb) res = cb(res);
return res;
};
Loading