Author Topic: Add new language support.  (Read 641 times)

cyberjok

  • Community Member
  • Posts: 12
  • Hero Points: 0
Add new language support.
« on: October 05, 2021, 08:19:27 am »
Any idea to add a new language very similar to Javascript ?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: Add new language support.
« Reply #1 on: October 05, 2021, 11:40:07 am »
Not sure I follow. Do you want a macro language similar to Javascript?

cyberjok

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Add new language support.
« Reply #2 on: October 20, 2021, 02:22:36 am »
Not sure I follow. Do you want a macro language similar to Javascript?

a new language aar,, similar to javascript;   i wanna to make SE support AAR;

Graeme

  • Senior Community Member
  • Posts: 2702
  • Hero Points: 336
Re: Add new language support.
« Reply #3 on: October 20, 2021, 02:58:21 am »
What does aar stand for?  Do you have a link?

cyberjok

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Add new language support.
« Reply #4 on: October 27, 2021, 01:22:02 am »

cyberjok

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Add new language support.
« Reply #5 on: January 05, 2022, 02:04:06 am »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: Add new language support.
« Reply #6 on: January 05, 2022, 02:47:19 am »
I can't find english docs for language syntax. That makes this impossible for SlickEdit. You could try adding language support yourself. If the syntax is very similar to JavaScript, try to inherit many settings from JavaScript.

Tools>Options>Languages>Language Manager>Add Language...

Set Mode name to "Aardio"
File extensions to ???
Set Color coding profile name to "JavaScript"
Set Copy settings from to "JavaScript" and turn on all the check boxes.

This may give you something very useful or not. No way for us to know. Worth a try though.

cyberjok

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Add new language support.
« Reply #7 on: January 07, 2022, 12:33:59 am »
I can't find english docs for language syntax. That makes this impossible for SlickEdit. You could try adding language support yourself. If the syntax is very similar to JavaScript, try to inherit many settings from JavaScript.

Tools>Options>Languages>Language Manager>Add Language...

Set Mode name to "Aardio"
File extensions to ???
Set Color coding profile name to "JavaScript"
Set Copy settings from to "JavaScript" and turn on all the check boxes.

This may give you something very useful or not. No way for us to know. Worth a try though.

ok. thanks.  that's a glue language for win32 apps.

cyberjok

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Add new language support.
« Reply #8 on: January 07, 2022, 08:52:33 am »
I can't find english docs for language syntax. That makes this impossible for SlickEdit. You could try adding language support yourself. If the syntax is very similar to JavaScript, try to inherit many settings from JavaScript.

Tools>Options>Languages>Language Manager>Add Language...

Set Mode name to "Aardio"
File extensions to ???
Set Color coding profile name to "JavaScript"
Set Copy settings from to "JavaScript" and turn on all the check boxes.

This may give you something very useful or not. No way for us to know. Worth a try though.

ok. thanks.  that's a glue language for win32 apps.

Code: [Select]
import console;

function toBaseN(num, base) {

if (num === 0) {
return '0';
}
var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var len = math.min(#digits,base);//Math.min(digits.length, base);
var result = '';
while (num > 0) {
result = digits[[num % len+1]] ++ result;
num = math.modf(num/len);//parseInt(num / len, 10);
}

return result;
}

function fromBaseN(str, base) {

if (str === null || #str === 0) {
return 0;
}
var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var len = math.min(#digits,base);//Math.min(digits.length, base);
var result = 0;
for (i=0 ; #str-1 ; 1) {
var p = string.indexOf(digits,str[[i+1]])-1;//digits.indexOf(str[i]);
if (p < 0 || p >= base) {
return null;
}
result += p * (#digits)**(#str-i-1);//Math.pow(digits.length, str.length - i - 1);
}

return result;
}

function toBase62(num) {

if (num === 0) {
return '0';
}
var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var result = '';
while (num > 0) {
result = digits[[num % #digits+1]] ++ result;
num = math.modf(num/#digits);
}

return result;
}

function fromBase62(str) {

var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var result = 0;
for (i=0 ; #str-1 ; 1) {
var p = string.indexOf(digits,str[[i+1]])-1;
if (p < 0) {
return null;
}
result += p * (#digits)**(#str-i-1);
}

return result;
}

console.log(toBaseN(999,62));   //999
console.log(fromBaseN("g7",62));//"g7"

console.log(toBase62(999));     //"g7"
console.log(fromBase62("g7"));  //999

console.pause(true);


just try goto defined toBaseN , ide shows a warning:

error opening tag file"...dotnet.vtg" patch not found.



Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: Add new language support.
« Reply #9 on: January 07, 2022, 04:54:23 pm »
Try using JavaScript mode.

Document>Select Mode...

Choose JavaScript.

How well does using JavaScript mode work for Aardio files?


cyberjok

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Add new language support.
« Reply #10 on: January 07, 2022, 11:44:57 pm »
Try using JavaScript mode.

Document>Select Mode...

Choose JavaScript.

How well does using JavaScript mode work for Aardio files?

works fine. thanks.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: Add new language support.
« Reply #11 on: January 07, 2022, 11:54:05 pm »
Try adding the Aardio file extensions to the JavaScript mode File Extension list if you haven't already done this.

Tools>Options>Languages>Web Authoring Langauges>JavaScript>General>File Extensions

This will allow JavaScript mode to automatically be chosen for Aardio file extensions.
« Last Edit: January 09, 2022, 03:26:20 am by Clark »