Add Pascal to language list

Back to General discussions forum

qwerty     2020-07-04 20:34:36

I think Pascal deserve to be included to list of languages from which user can choose. It is a quite popular language, isn't it? I myself programming Delphi at work (it is a dialect of Pascal).

qwerty     2020-07-07 06:49:55

Dear administrator, I hope you're alright. Please respond.

chunes_chunes     2020-07-09 09:06:00
User avatar

I would settle for being able to not syntax highlight a program.

Why are my Factor programs being highlighted as random languages? It looks ridiculous.

qwerty     2020-07-10 11:51:32

Sure, turning off syntax highlight for some languages would be a nice addition.

Rodion (admin)     2020-07-11 07:38:55
User avatar

Hi Friends!

To qwerty_one:

Dear administrator, I hope you're alright

Thanks usually I am, yes :) It just happened over years that due to various other small activities and projects besides my normal job I'm not always quick to react, sorry :)

I think Pascal... It is a quite popular language, isn't it?

Well, it definitely was popular - at least it was my first language (oh, nostalgy). However it definitely went into decline in beginning of 2000s while soaring Python took leading place in education during last years...

However I'm surprised "Pascal" is not in the list yet (despite 7 years).

Hm-m-m, how do we do this. Now! I hope Pascal will appear in submission interface and in search by solutions. (not sure I can add language highlight and, moreover, running it in sandbox that easily, sorry)

To chunes_chunes

I would settle for being able to not syntax highlight a program.

Eh... could you please explain which highlighting do you mean? Most probably we can but I can't at once catch what do you mean... In submission form you usually may choose "Other", right?

qwerty     2020-07-12 08:14:52

Hello, I tried to submit a Pascal solution and it worked! Thanks! Can I help you at least with language highlighting for Pascal? There are only 55 keywords in Turbo Pascal, so I'm pretty sure we can handle it.

qwerty     2020-07-12 08:21:24

The keywords are: absolute, and, array, asm, begin, case, const, constructor, destructor, div, do, downto, else, end, export, external, file, for, function, forward, goto, if, implementation, in, inherited, inline, interface, interrupt, label, library, mod, nil, not, object, of, or, packed, procedure, program, record, repeat, set, shl, shr, string, then, to, type, unit, until, uses, var, while, with, xor.

Rodion (admin)     2020-07-12 09:51:24
User avatar

The keywords are:

Hi again! Thanks, though really it's not exactly how things work :)

We use 3rd party libraries javascript libraries for highlighting of "view solution" page and for editor in submission form. Such tasks are really complicated enough to spent time on reinventing them (if you ever tried to write exercise like "program which removes comments from pascal code" you may judge yourself).

Keywords should not be highlighted in comments and strings, inside other words - and also usually highlighting uses some color for numbers, literals etc. Maintaining this for dozen of languages would be quite a project comparable in size to the site core itself... :)

I see the highlighting at view solution page works automatically, at least keywords seem bolded.

As for submission form, we use AceEditor there so most probably I need to recollect how to enable additional language here and, if necessary, load additional modules etc. I'll hopefully do this but probably bit later, as there are some other tasks which may be good to implement (e.g. see defunct forms in the bottom of profile settings page) - so I should compose myself and dedicate some time to this all :)

chunes_chunes     2020-07-15 04:55:53
User avatar

When you choose 'Other', your program still gets highlighted, but with a random existing language.

Example - view solution in "Factor" language

Notice how it thinks part of my program is a comment when it is not.

Rodion (admin)     2020-07-15 13:07:08
User avatar

Thanks for explanation! So it is in "view solution" page.

It uses some JS library for highlighting which detects language automatically... Well, so let's not initialize this library if the language is "Other". Should be single color from now on :)

BTW I'm still going to look into "Factor" one day. Years ago I was fond of FORTH which seemingly was a predecessor to Factor (judging by code I see), but lacked some standard compiler / processor and convenient functions for typical things... Still it was great for mental exercise! Also it is supposed to be close to my other long-term hobby - electronics and controllers...

chunes_chunes     2020-07-19 22:36:07
User avatar

Thanks for disabling the highlight for "other" languages. Looks much better now. :)

Please login and solve 5 problems to be able to post at forum