nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] python syntax: trying to not highlight print( and exec(


From: Ben Mintz
Subject: [Nano-devel] python syntax: trying to not highlight print( and exec(
Date: Tue, 18 Sep 2018 05:52:06 +0000

I'm working on a patch which would avoid highlighting the two
keywords-turned-functions in python 3. It assumes that print(x) is a function invocation
and print (x) is a statement.
Here's what I have:

color brightcyan "\<(exec|print)\>[^\(]"

This is inspired by highlight js doing the same:
https://github.com/highlightjs/highlight.js/blob/1d5e9c1add75abcb39663110bd78de9845da7607/src/languages/python.js#L116

This works fine until you have a line which just contains "print". In python 2, this prints
a newline.

How can I get that to be highlighted?

Thanks,
Benjamin Mintz
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]