Browse Source

Added % comments, not for any real reason

Getty Ritter 8 years ago
parent
commit
b7a80fcf6a
1 changed files with 12 additions and 0 deletions
  1. 12 0
      Data/SCargot/Comments.hs

+ 12 - 0
Data/SCargot/Comments.hs

@@ -11,6 +11,9 @@ module Data.SCargot.Comments
     -- ** Scripting Language Syntax
     -- $script
   , withOctothorpeComments
+    -- ** Prolog- or Matlab-Style Syntax
+  , withPercentComments
+  , withPercentBlockComments
     -- ** C-Style Syntax
     -- $clike
   , withCLikeLineComments
@@ -113,6 +116,15 @@ withHaskellComments = setComment (lineComment "--" <|>
 withOctothorpeComments :: SExprParser t a -> SExprParser t a
 withOctothorpeComments = setComment (lineComment "#")
 
+-- | MATLAB, Prolog, PostScript, and others use comments which begin
+-- with @%@ and last until the end of the line.
+withPercentComments :: SExprParser t a -> SExprParser t a
+withPercentComments = setComment (lineComment "%")
+
+-- | MATLAB block comments are started with @%{@ and end with @%}@.
+withPercentBlockComments :: SExprParser t a -> SExprParser t a
+withPercentBlockComments = setComment (simpleBlockComment "%{" "%}")
+
 
 {- $intro