Skip to content
Permalink
Browse files

Fix Pygments highlighting of directives with no arguments

  • Loading branch information...
pmoura committed Mar 14, 2019
1 parent 6ab39b2 commit 26cb709a041c9873bc204947e2408116c6505db1
Showing with 13 additions and 7 deletions.
  1. +6 −0 RELEASE_NOTES.md
  2. +7 −7 coding/pygments/logtalk.py
@@ -150,6 +150,12 @@ Ports
* FIXED: Warnings printed by the new lint checks while compiling a Metagol
example.

IDEs, text editors, and syntax highlighters support
---------------------------------------------------

* FIXED: Pygments highlighting of directives with no arguments to not colorize
the ending dot.


3.24.0 - February 28, 2019
==========================
@@ -27,10 +27,10 @@ class LogtalkLexer(RegexLexer):
tokens = {
'root': [
# Directives
(r'^\s*:-\s',Punctuation,'directive'),
(r'^\s*:-\s', Punctuation, 'directive'),
# Comments
(r'%.*?\n', Comment),
(r'/\*(.|\n)*?\*/',Comment),
(r'/\*(.|\n)*?\*/', Comment),
# Whitespace
(r'\n', Text),
(r'\s+', Text),
@@ -175,21 +175,21 @@ class LogtalkLexer(RegexLexer):
'directive': [
# Conditional compilation directives
(r'(el)?if(?=[(])', Keyword, 'root'),
(r'(e(lse|ndif))[.]', Keyword, 'root'),
(r'(e(lse|ndif))(?=[.])', Keyword, 'root'),
# Entity directives
(r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'),
(r'(end_(category|object|protocol))[.]',Keyword, 'root'),
(r'(end_(category|object|protocol))(?=[.])', Keyword, 'root'),
# Predicate scope directives
(r'(public|protected|private)(?=[(])', Keyword, 'root'),
# Other directives
(r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'),
(r'in(clude|itialization|fo)(?=[(])', Keyword, 'root'),
(r'(built_in|dynamic|synchronized|threaded)[.]', Keyword, 'root'),
(r'(built_in|dynamic|synchronized|threaded)(?=[.])', Keyword, 'root'),
(r'(alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|ode|ultifile)|s(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'),
(r'op(?=[(])', Keyword, 'root'),
(r'(c(alls|oinductive)|module|reexport|use(s|_module))(?=[(])', Keyword, 'root'),
(r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'),
(r'[a-z][a-zA-Z0-9_]*[.]', Text, 'root'),
(r'[a-z][a-zA-Z0-9_]*(?=[.])', Text, 'root'),
],

'entityrelations': [
@@ -215,7 +215,7 @@ class LogtalkLexer(RegexLexer):
(r'[()\[\],.|]', Text),
# Comments
(r'%.*?\n', Comment),
(r'/\*(.|\n)*?\*/',Comment),
(r'/\*(.|\n)*?\*/', Comment),
# Whitespace
(r'\n', Text),
(r'\s+', Text),

0 comments on commit 26cb709

Please sign in to comment.
You can’t perform that action at this time.