SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: cyberjok on October 05, 2021, 08:19:27 am

Title: Add new language support.
Post by: cyberjok on October 05, 2021, 08:19:27 am
Any idea to add a new language very similar to Javascript ?
Title: Re: Add new language support.
Post by: Clark on October 05, 2021, 11:40:07 am
Not sure I follow. Do you want a macro language similar to Javascript?
Title: Re: Add new language support.
Post by: cyberjok 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;
Title: Re: Add new language support.
Post by: Graeme on October 20, 2021, 02:58:21 am
What does aar stand for?  Do you have a link?
Title: Re: Add new language support.
Post by: cyberjok on October 27, 2021, 01:22:02 am
aardio https://www.aardio.com/
Title: Re: Add new language support.
Post by: cyberjok on January 05, 2022, 02:04:06 am
aardio https://www.aardio.com/
so any idea ?
Title: Re: Add new language support.
Post by: Clark 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.
Title: Re: Add new language support.
Post by: cyberjok 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.
Title: Re: Add new language support.
Post by: cyberjok 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.


Title: Re: Add new language support.
Post by: Clark 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?

Title: Re: Add new language support.
Post by: cyberjok 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.
Title: Re: Add new language support.
Post by: Clark 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.