zsh completion file incorrectly identified as prolog

Create issue
Issue #1144 new
Antony Lee created an issue

The zsh (completion) script at http://pastebin.com/XW0nPWjG is identified as prolog by the lexer guesser.

Comments (5)

  1. Tim Hatch
    • marked as minor
    • changed component to lexers
    • changed milestone to 2.1

    Yes, this is bad; prolog uses the existence of ":-" as its only check, which can easily occur in shell scripts (or others).

  2. Antony Lee reporter

    Actually, ":-" occurs even relatively commonly in python files (array[:-1]). Shebangs don't really help because PrologLexer.analyse_text returns 1 if it sees ":-", immediately stopping the looping through all lexers. It should probably return some tiny positive value, like 0.1. (Certainly the shebang should have higher priority.)

  3. Log in to comment