Results 1 to 8 of 8

Thread: JScript vs Javascript - error in wsf compilation of Tau-Prolog

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2015
    Posts
    38

    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?

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    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?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2015
    Posts
    38

    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;
    	}
    Quote Originally Posted by dday9 View Post
    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?

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    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.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  5. #5
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Member
    Join Date
    Dec 2015
    Posts
    38

    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.

    Quote Originally Posted by techgnome View Post
    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

  7. #7

    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...

  8. #8

    Thread Starter
    Member
    Join Date
    Dec 2015
    Posts
    38

    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.


    Quote Originally Posted by yqqwe123 View Post
    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
  •  



Click Here to Expand Forum to Full Width