Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tau-prolog

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tau-prolog - npm Package Compare versions

Comparing version 0.2.65 to 0.2.66

150

modules/js.js

@@ -106,88 +106,88 @@ var pl;

// JS OBJECTS
// Is a JS object
pl.type.is_js_object = function( obj ) {
return obj instanceof pl.type.JSValue;
};
function define_properties() {
// Is a JS object
pl.type.is_js_object = function( obj ) {
return obj instanceof pl.type.JSValue;
};
// Ordering relation
pl.type.order.push( pl.type.JSValue );
// Ordering relation
pl.type.order.push( pl.type.JSValue );
// JSValue Prolog object
pl.type.JSValue = function( value ) {
this.value = value;
}
// JSValue Prolog object
pl.type.JSValue = function( value ) {
this.value = value;
}
// toString
pl.type.JSValue.prototype.toString = function() {
return "<javascript>(" + (typeof this.value).toLowerCase() + ")";
};
// toString
pl.type.JSValue.prototype.toString = function() {
return "<javascript>(" + (typeof this.value).toLowerCase() + ")";
};
// clone
pl.type.JSValue.prototype.clone = function() {
return new pl.type.JSValue( this.value );
};
// clone
pl.type.JSValue.prototype.clone = function() {
return new pl.type.JSValue( this.value );
};
// equals
pl.type.JSValue.prototype.equals = function( obj ) {
return pl.type.is_js_object( obj ) && this.value === obj.value;
};
// equals
pl.type.JSValue.prototype.equals = function( obj ) {
return pl.type.is_js_object( obj ) && this.value === obj.value;
};
// rename
pl.type.JSValue.prototype.rename = function( _ ) {
return this;
};
// rename
pl.type.JSValue.prototype.rename = function( _ ) {
return this;
};
// get variables
pl.type.JSValue.prototype.variables = function() {
return [];
};
// get variables
pl.type.JSValue.prototype.variables = function() {
return [];
};
// apply substitutions
pl.type.JSValue.prototype.apply = function( _ ) {
return this;
};
// apply substitutions
pl.type.JSValue.prototype.apply = function( _ ) {
return this;
};
// unify
pl.type.JSValue.prototype.unify = function( obj, _ ) {
if( pl.type.is_js_object( obj ) && this.value === obj.value ) {
return new pl.type.State( obj, new pl.type.Substitution() );
}
return null;
};
// unify
pl.type.JSValue.prototype.unify = function( obj, _ ) {
if( pl.type.is_js_object( obj ) && this.value === obj.value ) {
return new pl.type.State( obj, new pl.type.Substitution() );
}
return null;
};
// interpret
pl.type.JSValue.prototype.interpret = function( indicator ) {
return pl.error.instantiation( indicator );
};
// interpret
pl.type.JSValue.prototype.interpret = function( indicator ) {
return pl.error.instantiation( indicator );
};
// compare
pl.type.JSValue.prototype.compare = function( obj ) {
if( this.value === obj.value ) {
return 0;
} else if( this.value < obj.value ) {
return -1;
} else if( this.value > obj.value ) {
return 1;
}
};
// compare
pl.type.JSValue.prototype.compare = function( obj ) {
if( this.value === obj.value ) {
return 0;
} else if( this.value < obj.value ) {
return -1;
} else if( this.value > obj.value ) {
return 1;
}
};
// to javascript
pl.type.JSValue.prototype.toJavaScript = function() {
return this.value;
};
// from javascript
pl.fromJavaScript.conversion.any = function( obj ) {
return new pl.type.JSValue( obj );
};
// JavaScript error
pl.error.javascript = function( error, indicator ) {
return new pl.type.Term( "error", [new pl.type.Term( "javascript_error", [new pl.type.Term( error )] ), pl.utils.str_indicator( indicator )] );
};
}
// to javascript
pl.type.JSValue.prototype.toJavaScript = function() {
return this.value;
};
// from javascrip
pl.fromJavaScript.conversion.any = function( obj ) {
return new pl.type.JSValue( obj );
};
// JavaScript error
pl.error.javascript = function( error, indicator ) {
return new pl.type.Term( "error", [new pl.type.Term( "javascript_error", [new pl.type.Term( error )] ), pl.utils.str_indicator( indicator )] );
};

@@ -198,5 +198,7 @@

pl = p;
define_properties();
new pl.type.Module( "js", predicates(), exports );
};
} else {
define_properties();
new pl.type.Module( "js", predicates(), exports );

@@ -203,0 +205,0 @@ }

{
"name": "tau-prolog",
"version": "0.2.65",
"description": "An open source Prolog interpreter in JavaScript",
"main": "./modules/core.js",
"scripts": {
"example:fruit": "node examples/nodejs/fruit",
"test": "node_modules/.bin/qunit test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jariazavalverde/tau-prolog.git"
},
"keywords": [
"tau-prolog",
"prolog-interpreter",
"iso-prolog-standard",
"javascript",
"prolog"
],
"files": [
"modules",
"examples",
"test"
],
"author": "jariazavalverde",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/jariazavalverde/tau-prolog/issues"
},
"homepage": "http://tau-prolog.org/",
"dependencies": {
"qunit": "^2.8.0",
"readline-sync": "1.4.9",
"fs": "0.0.1-security"
}
}
"name": "tau-prolog",
"version": "0.2.66",
"description": "An open source Prolog interpreter in JavaScript",
"main": "./modules/core.js",
"scripts": {
"example:fruit": "node examples/nodejs/fruit",
"test": "node_modules/.bin/qunit test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jariazavalverde/tau-prolog.git"
},
"keywords": [
"tau-prolog",
"prolog-interpreter",
"iso-prolog-standard",
"javascript",
"prolog"
],
"files": [
"modules",
"examples",
"test"
],
"author": "jariazavalverde",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/jariazavalverde/tau-prolog/issues"
},
"homepage": "http://tau-prolog.org/",
"dependencies": {
"qunit": "^2.8.0",
"readline-sync": "1.4.9",
"fs": "0.0.1-security"
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc