aboutsummaryrefslogtreecommitdiff
path: root/hypsrc-test/src/CPP.hs
blob: 59cb603470d35a800e4c3e80a847eaaa097997ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE CPP #-}
module CPP where

#define SOMETHING1

foo :: String
foo = {-  " single quotes are fine in block comments
          {- nested block comments are fine -}
       -} "foo"

#define SOMETHING2

bar :: String
bar = "block comment in a string is not a comment {- "

#define SOMETHING3

-- " single quotes are fine in line comments
-- {- unclosed block comments are fine in line comments

-- Multiline CPP is also fine
#define FOO\
  1

baz :: String
baz = "line comment in a string is not a comment --"