es5 javascript syntax support

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

es5 javascript syntax support

Postby reslear » Sun Apr 09, 2017 10:47 am

add in to html and javascrip XS file:
Code: Select all
// es5 by ReSLeaR-

//var
sjsnormal2 'let'          sjsnormal tjsresword
sjsnormal2 'const'        sjsnormal tjsresword
sjsnormal 'let'          sjsnormal tjsresword
sjsnormal 'const'        sjsnormal tjsresword

//strings
sjsnormal   \`                    sjsstring2    tjsstring
sjsnormal2  \`                    sjsstring2    tjsstring
sjsstring2  [^\`]*                sjsstring2    tjsstring
sjsstring2  \`                    sjsnormal     tjsstring
sjsstring2  \`\`                  sjsstring2    tjsstring
sjsstring2  \\\\                  sjsstring2    tjsstring
sjsstring2  \\\`                  sjsstring2    tjsstring
sjsstring2  \\[^\\]               sjsstring2    tjsstring
sjsstring2  $                     sjsnormal     tjsstring


how to hightlight ${output} in

Image
Code: Select all
body: `Файл <b>${output}</b> скомпилирован, нажмите что бы открыть в проводнике.`,


and {dialog, shell} in

Code: Select all
const {dialog, shell} = require('electron');

Image

please help
reslear
 
Posts: 6
Joined: Sat Nov 12, 2016 10:46 am
Location: Belarus Minsk

Re: es5 javascript syntax support

Postby Aivars » Mon Apr 10, 2017 3:53 pm

The red line is because jslint does not support that syntax. I can't suggest any way to get rid of that except to disable JS error checking for now.

Thank you for JS syntax update suggestions, we were planning to do this, so we might as well use your modifications. Thanks again!
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: es5 javascript syntax support

Postby reslear » Tue Apr 11, 2017 12:27 am

eslint update is planned?
reslear
 
Posts: 6
Joined: Sat Nov 12, 2016 10:46 am
Location: Belarus Minsk

Re: es5 javascript syntax support

Postby Aivars » Tue Apr 11, 2017 10:00 am

The problem is that JSLint is a 3rd party application and it hasn't been updated. We need to be looking for a replacement. Any suggestions?
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: es5 javascript syntax support

Postby pmk65 » Tue Apr 11, 2017 5:43 pm

Aivars wrote:The problem is that JSLint is a 3rd party application and it hasn't been updated. We need to be looking for a replacement. Any suggestions?


JSHint. That's the "standard" Javascript Linter today. Much better than the original JSLint by Douglas Crockford.
It support ECMAScript 3 to 6 and development is active. http://jshint.com/about/

Only "problem" is that it requires Nodejs.. But maybe it's time to implement Nodejs support in WeBuilder? :roll:

I have written a JSHint plugin that can be used to check scripts for errors. (You'll need to integrate JSHint differently in order to check for syntax errors at runtime)
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: es5 javascript syntax support

Postby Aivars » Tue Apr 11, 2017 5:47 pm

The problem with node.js is the size. I'll look into it, maybe there's some compact way to do it.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: es5 javascript syntax support

Postby pmk65 » Tue Apr 11, 2017 5:52 pm

Aivars wrote:The problem with node.js is the size. I'll look into it, maybe there's some compact way to do it.


The size of Nodejs installer is around 10Mb/11Mb so it's not that bad. https://nodejs.org/en/download/
And it's a 1-time installation.

The Nodejs script (like JSHint) are fairly small in size.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 7 guests

cron