diff options
author | Paulo Moura <pmoura@logtalk.org> | 2014-09-16 09:45:35 +0000 |
---|---|---|
committer | Paulo Moura <pmoura@logtalk.org> | 2014-09-16 09:45:35 +0000 |
commit | ee3d33a5fee236ccff80b6e0571b56e073883dce (patch) | |
tree | c96e9352bf11e797a942b7169a24bc7fb3b4ab54 /pygments/lexers/other.py | |
parent | b0704914d698b7b7f801b9435250061694676b35 (diff) | |
download | pygments-ee3d33a5fee236ccff80b6e0571b56e073883dce.tar.gz |
When analyzing, replace the too broad `:-` sequence by a regular expression matching directives.
Diffstat (limited to 'pygments/lexers/other.py')
-rw-r--r-- | pygments/lexers/other.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py index 4f11f35d..d21f7b30 100644 --- a/pygments/lexers/other.py +++ b/pygments/lexers/other.py @@ -694,13 +694,14 @@ class LogtalkLexer(RegexLexer): def analyse_text(text): if ':- object(' in text: return True - if ':- protocol(' in text: + elif ':- protocol(' in text: return True - if ':- category(' in text: + elif ':- category(' in text: return True - if ':-' in text: - return True - return False + elif re.search('^:-\s[a-z]', text, re.M): + return 0.9 + else: + return False def _shortened(word): |