-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperl-checker.hs
More file actions
30 lines (20 loc) · 776 Bytes
/
perl-checker.hs
File metadata and controls
30 lines (20 loc) · 776 Bytes
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
28
29
30
{-# OPTIONS_GHC -fglasgow-exts #-}
import Prelude hiding (lines)
import Data.Maybe (fromMaybe, isNothing, fromJust)
import Perl5Parser.Types
import Perl5Parser.Prototype
import Perl5Parser.ParserHelper
import Perl5Parser.Lines
--------------------------------------------------------------------------------
prog :: Perl5Parser Node
prog = newNode "prog" $ do
l1 <- toTokens spaces_comments
l2 <- lines
eof <?> ""
return$ l1 ++ l2
--------------------------------------------------------------------------------
test_file = "/tmp/t.pl"
--test_file = "/home/pixel/cooker/soft/perl-MDK-Common/MDK/Common/File.pm"
test file = readFile file >>= parseTest prog initial_state
main = test_lexemes >> test test_file
_t = parse_prototype