-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBUILD.bazel
132 lines (124 loc) · 3.4 KB
/
BUILD.bazel
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
load("@rules_haskell//haskell:defs.bzl", "haskell_library")
load("//third_party/haskell/alex:build_defs.bzl", "alex_lexer")
load("//third_party/haskell/happy:build_defs.bzl", "happy_parser")
load("//third_party/haskell/hspec-discover:build_defs.bzl", "hspec_test")
load("//tools/project:build_defs.bzl", "project")
project(license = "gpl3-https")
haskell_library(
name = "ast",
srcs = ["src/Language/Happy/Ast.hs"],
src_strip_prefix = "src",
tags = [
"haskell",
"no-cross",
],
visibility = ["//hs-happy-arbitrary:__subpackages__"],
deps = [
"//third_party/haskell:aeson",
"//third_party/haskell:base",
"//third_party/haskell:data-fix",
"//third_party/haskell:transformers-compat",
],
)
alex_lexer(
name = "Lexer",
src = "src/Language/Happy/Lexer.x",
)
haskell_library(
name = "lexer",
srcs = [
"src/Language/Happy/Tokens.hs",
":Lexer",
],
src_strip_prefix = "src",
tags = [
"haskell",
"no-cross",
],
visibility = ["//hs-happy-arbitrary:__subpackages__"],
deps = [
"//third_party/haskell:aeson",
"//third_party/haskell:array",
"//third_party/haskell:base",
"//third_party/haskell:bytestring",
"//third_party/haskell:text",
],
)
happy_parser(
name = "Parser",
src = "src/Language/Happy/Parser.y",
)
haskell_library(
name = "parser",
srcs = [":Parser"],
extra_srcs = ["src/Language/Happy/Parser.y"],
ghcopts = ["-DSOURCE=\"$(location src/Language/Happy/Parser.y)\""],
src_strip_prefix = "src",
tags = [
"haskell",
"no-cross",
],
visibility = ["//hs-happy-arbitrary:__subpackages__"],
deps = [
":ast",
":lexer",
"//third_party/haskell:aeson",
"//third_party/haskell:array",
"//third_party/haskell:base",
"//third_party/haskell:bytestring",
"//third_party/haskell:data-fix",
"//third_party/haskell:file-embed",
"//third_party/haskell:text",
"//third_party/haskell:transformers-compat",
],
)
haskell_library(
name = "hs-happy-arbitrary",
srcs = glob(
["src/**/*.*hs"],
exclude = [
"src/Language/Happy/Tokens.hs",
"src/Language/Happy/Ast.hs",
],
),
src_strip_prefix = "src",
tags = [
"haskell",
"no-cross",
],
version = "0.0.2",
visibility = ["//visibility:public"],
deps = [
":ast",
":lexer",
":parser",
"//third_party/haskell:QuickCheck",
"//third_party/haskell:aeson",
"//third_party/haskell:array",
"//third_party/haskell:base",
"//third_party/haskell:bytestring",
"//third_party/haskell:containers",
"//third_party/haskell:data-fix",
"//third_party/haskell:extra",
"//third_party/haskell:file-embed",
"//third_party/haskell:mtl",
"//third_party/haskell:text",
"//third_party/haskell:transformers-compat",
],
)
hspec_test(
name = "testsuite",
size = "small",
deps = [
":ast",
":hs-happy-arbitrary",
":lexer",
":parser",
"//third_party/haskell:QuickCheck",
"//third_party/haskell:base",
"//third_party/haskell:bytestring",
"//third_party/haskell:groom",
"//third_party/haskell:hspec",
"//third_party/haskell:text",
],
)