|
Send me
1. The language you'd like to see
2. A list of keywords and/or any info on the syntax such as comment and string quote formats
and I'll see if I can add it
We've had a loooong term goal of simply reusing the textbrush or highlight.js syntax definition structure but at the time we investigated they weren't so good at dealing with languages within languages (eg HTML turns into Razor which turns into Javascript etc). I'm pretty sure they are all way better at this now, but we've just not got around to it.
However, adding new languages to our system isn't too painful.
cheers
Chris Maunder
|
|
|
|
|
Hi Chris,
Can you show a sample data structure (or list of what you need) so I can prepare things, or should I trow information and you do all the work ?
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I'll do all the work if someone buys me a beer
(Just throw me what you have and I'll make it happen)
cheers
Chris Maunder
|
|
|
|
|
First language: xBase family
First incarnation was dBase II in the 80's. Most popular incarnation was certainly FoxPro (MS Visual FoxPro). Other incarnations were Clipper, Harbour, xHarbour, XSharp ...
Let me know the name you choose.
Keywords are not case sensitive
* is full line comment, single line
is end of line comment, single line, same as C
is multi lines comment, same as C
is multi lines comment, same as C
*/
Nil: NIL
String: "hello", 'hello'
Logical: .T., .F.
Number: 1, 1.1, -1, 0xFF
[STATIC] [UTILITY] FUNCTION <funcName>( [<params,...>] )
<Statements>
RETURN <retVal>
[STATIC] [UTILITY] PROCEDURE <procName>( [<params,...>] )
<Statements>
RETURN
[DO] WHILE <Condition>
<Statements>
[EXIT]
<Statements>
[LOOP]
<Statements>
END[DO]
FOR <nCounter> := <nStart> TO <nEnd> [STEP <nIncrement>]
<Statements>
[EXIT]
<Statements>
[LOOP]
NEXT
FOR EACH <element> IN <array>|<object>|<string>
<statements>
[LOOP]
<statements>
[EXIT]
NEXT
IF <Condition1>
<Statements>
[ ELSEIF <ConditionN>
<Statements> ] [ ELSE
<Statements> ] END[IF]
DO CASE
CASE <Condition1>
<Statements1>
[ CASE <ConditionN>
<StatementsN> ]
[ OTHERWISE
<defaultStatements> ]
END[CASE]
Sample code colorized as vb:
// Trial Division Square Root + Wheel
function TD_SRW(Prod)
local D, Top, SPrimes, Wheel, W
// Check small primes
SPrimes= {2, 3}
Wheel= {4, 2}
for each D in SPrimes
if Prod % D = 0
return D
endif
next
// Start the wheel
D= 1
Top= int(sqrt(Prod))
while D <= Top
for each W in wheel
D += W
if Prod % D = 0
return D
endif
next
enddo
return Prod
Let me know if you need more details.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
How's this:
function TD_SRW(Prod)
local D, Top, SPrimes, Wheel, W
SPrimes= {2, 3}
Wheel= {4, 2)
for each D in SPrimes
if Prod % D = 0
return D
endif
next
D= 1
Top= int(sqrt(Prod))
while D <= Top
for each W in wheel
D += W
if Prod % D = 0
return D
endif
next
enddo
return Prod
Basic for now, but
<pre lang="dbase">...</pre> will get you there
cheers
Chris Maunder
|
|
|
|
|
Looks great to me, thanks.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Hi Chris,
Looks like the "Browse code" in Articles do not recognize the files in the dbase language.
Those files are *.prg
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Can you please point me to an article with a download that contains a dbase language? (I could hunt figured it would be easier to ask one who knows)
cheers
Chris Maunder
|
|
|
|
|
|
All fixed.
cheers
Chris Maunder
|
|
|
|
|
Thank you.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
By the way, is there a list of supported languages in <pre> tag ?
I am unable to find it.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
The article editor lists the following choices when formatting a code box: No language, ASM, ASP, ASP.NET, BAT/CMD, C#, C++, C++/CLI, COBOL, CSS, Dart, F#, FORTRAN, HTML, Java, Kotlin, Javascript, Lua, MSIL, MIDL, Objective C, Pascal/Delphi, Perl, PHP, PowerShell, Python, Razor, Scala, Shell/Bash, SQL, Swift, VB.NET, VBScript, XML.
|
|
|
|
|
Thank you, but I am suspecting some other languages are supported, but unlisted.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Hello,
can you delete my account ?
modified 26-Dec-20 21:02pm.
|
|
|
|
|
You can do it yourself:
CodeProject Member FAQ[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
So - after many years I got the urge to change my avatar. Picked it out, squared it to fit. At 57K, the .jpg probably met the <500K criterion.
Nothing happens. Ignoring Einstein's advice, I repeated the same task expecting different results (insanity had firmly gripped me long ago).
So, what's the secret?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
It now looks like the Mad Hatter instead of a Panopticon device.
|
|
|
|
|
Thanks - it did finally get through. Something new (compared to the years ago when last updated): it seems to now be cached.
The Panoptican? It came directly from the deep within the Gallifreian Matrix.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Sorry, I'm not familiar with that.
|
|
|
|
|
The "Panoptican" is the central meeting place of the Time Lords on Gallefrey.[^]. It's quite important and is referenced (on the linked page) on the right-margin blurb as "Notable:"
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
This reminded me of our old Maths master at Senior School - he was blind in one eye, but we students could never remember which one, and we never knew in which direction he was looking (he was a "master" at camouflaging it too!)
Best behaved class in school
|
|
|
|
|
Having developed cataracts (awaiting surgery), I am experiencing more difficulty reading web sites and some apps as time passes - both on my desktop and phone.
Some web sites allow for this by providing a "Dark/High Contrast Setting/Theme". The browsers themselves have such settings but they don't obviously affect the vast majority of sites visited. Google actually does a fairly good job in this regard.
Thanks for considering this suggestion.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
That's absolutely in the plan.
cheers
Chris Maunder
|
|
|
|
|