-
Jun 18th, 2021, 09:27 AM
#1
Thread Starter
Member
JScript vs Javascript - error in wsf compilation of Tau-Prolog
Hi,
I'm trying to test the compilation - without actually running any of it - of the tau-prolog module, inside of a wsf container.
The code so far is
Code:
<package>
<job id="test">
<script language="JScript" src="tau-prolog.js" >
</script>
<script language="JScript">
// first test of tau prolog in a wsf file
var Var_x ;
var_x = "what the...?" ;
WScript.Echo( var_x ) ;
</script>
</job>
</package>
, and the tau-prolog.js file can be found at
http://tau-prolog.org/tau-prolog.js
The first error, which is easy to fix, is on line 1663
Code:
nodejs_flag ? nodejs_user_error : tau_user_error,
"append", "user_error", "text", false, "reset" ), // -> I REMOVED THE COMMA HERE ON LINE 1662, IN ORDER TO COMPILE
}; // - THIS IS LINE 1663
this.file_system = nodejs_flag ? nodejs_file_system : tau_file_system;
, but the confusing error is over on line 1726. It looks like it's referring to the dot between 'this' and 'debugger,' but it might be pointing to something else:
Code:
this.points = [];
this.debugger = false; // - LINE 1726. The statement is tabbed over in the .js file, so the . dot is at column 9.
this.debugger_states = [];
C:\Personal_Programming\TauProlog\test.wsf(1726, 9) Microsoft JScript compilation error: Expected identifier
Do you think that it's NOT worth trying to use tau-prolog in Jscript, because of the difference in environments? Is there a repository of strictly JScript (not Javascript, even though they are nearly identical) code, for the WScripting/CScripting environment, that might have an implementation of Prolog?
-
Jun 18th, 2021, 03:27 PM
#2
Re: JScript vs Javascript - error in wsf compilation of Tau-Prolog
I cannot speak to JScript, but whitespace in between this and debugger is valid (albeit sloppy) JavaScript. For example, this is valid:
Code:
var obj = { foo: 1 }
console.log(obj .foo);
Fiddle: https://jsfiddle.net/52ormpge/
Could you post some more code before and after that statement?
-
Jun 18th, 2021, 07:35 PM
#3
Thread Starter
Member
Re: JScript vs Javascript - error in wsf compilation of Tau-Prolog
Hi Dday9,
Code:
// Threads
function Thread( session ) {
this.epoch = Date.now();
this.session = session;
this.session.total_threads++;
this.format_success = session.format_success;
this.format_error = session.format_error;
this.total_steps = 0;
this.cpu_time = 0;
this.cpu_time_last = 0;
this.points = [];
this.debugger = false;
this.debugger_states = [];
this.level = new Term("top_level");
this.current_limit = this.session.limit;
this.has_limit = this.session.limit !== null;
this.warnings = [];
this.__calls = [];
this.__goal_expansion = false;
}
Originally Posted by dday9
I cannot speak to JScript, but whitespace in between this and debugger is valid (albeit sloppy) JavaScript. For example, this is valid:
Code:
var obj = { foo: 1 }
console.log(obj .foo);
Fiddle: https://jsfiddle.net/52ormpge/
Could you post some more code before and after that statement?
-
Jun 18th, 2021, 07:51 PM
#4
Re: JScript vs Javascript - error in wsf compilation of Tau-Prolog
Hmm, nothing in that really jumps out that would cause that error. I'm not exactly sure what could be causing that particular issue to be honest.
-
Jun 19th, 2021, 01:01 PM
#5
Re: JScript vs Javascript - error in wsf compilation of Tau-Prolog
The only thing that comes to mind is if maybe debugger isn't a valid property. Or it's a readonly property and can't be set.
-tg
-
Jun 20th, 2021, 04:08 PM
#6
Thread Starter
Member
Re: JScript vs Javascript - error in wsf compilation of Tau-Prolog
Yeah, but it works in the context of Javascript applications. It's only JScript that's reporting a problem.
Anyway, I think I'll scrap Tau-Prolog and try some other Javascript implementations.
Thanks, everyone.
Originally Posted by techgnome
The only thing that comes to mind is if maybe debugger isn't a valid property. Or it's a readonly property and can't be set.
-tg
-
Jul 28th, 2021, 10:15 PM
#7
New Member
Re: JScript vs Javascript - error in wsf compilation of Tau-Prolog
i think javascript is much better choice than jscript, it has better future and better usage coverage,microsoft jscript is a very old language, without any new upgrade...
-
Jul 29th, 2021, 08:36 AM
#8
Thread Starter
Member
Re: JScript vs Javascript - error in wsf compilation of Tau-Prolog
Of course modern Javascript is better in an absolute sense, than the older JScript. But it depends on your development context.
Modern Javascrsipt isn't an option in the Windows WSH environment, i.e. WScript. It interprets an older version of Javascript, and VBScript.
Anyway, there's obviously no solution to this. I'll just keep searching and tweaking.
Originally Posted by yqqwe123
i think javascript is much better choice than jscript, it has better future and better usage coverage,microsoft jscript is a very old language, without any new upgrade...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|