Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1459 Improvements to Haskell Lexer

Bug
closed-fixed
Neil Hodgson
3
2013-07-21
2013-04-03
kudah
No
  • Added support for MagicHash extension (lexer.haskell.allow.hash)
  • $ and # are now colored as operators.
  • .0 and -0 are now properly colored as operator and a number, not as just number.
  • Operators starting with double dash (e.g ---->) are properly colored as operators, not comments.
  • Added pragma highlighting.
  • Added basic C-preprocessor highlighting.
  • Qualified names (e.g. ABC.xyz) are now properly highlighted as identifiers, not types.
  • Qualified operators (e.g. ABC.<$>) are now properly highlighted as operators.
  • Operator . is now properly highlighted as an operator, not part of the identifier, when applied to a qualified and an unqualified value (e.g. Abc.xyz.yzx <- last one is an operator)
  • Operators starting with ':' are now properly highlighted as type constructors, not operators.
  • "family" after "data" is highlighted, as per TypeFamilies.
1 Attachments

Discussion

1 2 3 .. 8 > >> (Page 1 of 8)
  • Neil Hodgson
    Neil Hodgson
    2013-04-04

    There's a comment convention (starting with "// property ") for new lexer-specific properties which allows containers to automatically set up documentation/UI. See LexPython.cxx for examples.

    There is some strange stuff near the top of the .patch (the block that includes ++++++++++++++++++++++--------------) which ends up in the commit message.

    Is "kudah" the correct name for credits lists? Unicode is fine for names.

     
    • kudah
      kudah
      2013-04-04

      There's a comment convention (starting with "// property ") for new lexer-specific properties which allows containers to automatically set up documentation/UI. See LexPython.cxx for examples.

      Okay, added a property comment in attachment.

      There is some strange stuff near the top of the .patch (the block that includes ++++++++++++++++++++++--------------) which ends up in the commit message.

      It's git commit summary.

      Is "kudah" the correct name for credits lists? Unicode is fine for names.

      It's a nickname. If a real name is obligatory, I'd rather just hand over copyright.

       
      Last edit: kudah 2013-04-04
  • kudah
    kudah
    2013-04-04

    Reformatted as a single patch.

     
    Last edit: kudah 2013-04-04
  • Neil Hodgson
    Neil Hodgson
    2013-04-05

    Committed as [0b7306].

     

    Related

    Commit: [0b7306]

  • kudah
    kudah
    2013-04-05

    Thanks!

     
  • kudah
    kudah
    2013-04-07

    Fixed few things in haskell lexer

    • MagicHash now applies to literals.
    • MagicHash is now only allowed at the end of identifier.
    • SafeHaskell imports are now highlighted (lexer.haskell.import.safe)
    • TemplateHaskell quoted names are now highlighted
    • Constructors promoted to types are now highlighted
    • Promoted tuples, lists, and operator constructors are now highlighted.
    • Qualified constructors are now properly highlighted as constructors, not operators.
    • Capital and qualified names in import lists are now properly highlighted.
    • A.$b is not properly highlighted as an operator and an identifier, not just operator.
    • String and preprocessor continuations now work with CRLF.
     
  • Neil Hodgson
    Neil Hodgson
    2013-04-08

    g++ produces a warning:
    ../lexers/LexHaskell.cxx: In function 'void skipMagicHash(StyleContext&, bool, bool)':
    ../lexers/LexHaskell.cxx:90:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]

     
  • kudah
    kudah
    2013-04-09

    Oops, my previous patch broke string escaping, fixed. Also fixed nested comments, which were a bit broken since the beginning, and completely broken since my first patch. Copied over python's Folder with adjustments; it's moderately useful as is, even though it doesn't yet handle NondecreasingIndentation, explicit braces, Haddock comments and group definitions.

     
  • Neil Hodgson
    Neil Hodgson
    2013-04-12

    There's one line that appears to have no effect, 506, with the result not used after it is set:

    // Set up initial loop state
    startPos = styler.LineStart(lineCurrent);

     
  • kudah
    kudah
    2013-04-12

    • Converted Haskell lexer to a class
    • Removed external lexer
    • Haskell lexer now folds imports
     
1 2 3 .. 8 > >> (Page 1 of 8)