Syntax Highlighting Tuning


#1

Dear all,

My school teacher requires Pascal code so I must write my homeworks in it.
Earlier I used Sublime 3 but now I want to move in Atom, but there’s no Pascal syntax highlighting in Atom. I downloaded 2 packages: language-pascal and pascal. Now I want to mark function name when i call it in recursion. A there any ways to change highlighting settings?


#2

Atom’s old TextMate-based grammar system, which is what is used by the two language packages you’ve downloaded, has no way of being context-aware. All it can do is highlight based on syntax patterns. There’s a newer system that has the ability to read language nodes, but Pascal is an ancient language without much popularity these days, so it hasn’t (to my knowledge) got anyone actively working to develop the new form of language recognition.


#3

So, can I find or write my own package wth this function, I was talking about?

Atom’s old TextMate-based grammar system, which is what is used by the two language packages you’ve downloaded, has no way of being context-aware

yep, but my teacher wants us to code in pascal xDD

Pascal is an ancient language without much popularity these days


#4

You can write your own, sure.

You’re not likely to use it after this class, so is it worthwhile to write a whole grammar for it? Maybe, if it’s something you really want to learn, or you really enjoy Pascal. It is not going to be easy for you to write a grammar from scratch if you’re a newbie programmer.


#6

I know other languages as cpp and python for competitions quite good and Im learning swift for applied programming, but at school I need to code in pascal cause he makes us to do some sets of tasks as graphs ONLY in pascal. Actually, I cant understand his logic))


#7

Well, if you want to tackle this, you will want to check out that link I posted. You can also consult existing grammars, the Tree-sitter documentation, and some of the other threads in this forum. @Aerijo is a fairly active user who is engaged in a lot of discussions about Tree-sitter, so if you seek out his posts you’ll find some good advice.