forked from TokTok/hs-cimple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
116 lines (107 loc) · 2.82 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
load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library")
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(custom_github = True)
alex_lexer(
name = "Lexer",
src = "src/Language/Cimple/Lexer.x",
)
haskell_library(
name = "lexer",
srcs = [
"src/Language/Cimple/Lexer.hs",
"src/Language/Cimple/Tokens.hs",
],
src_strip_prefix = "src",
visibility = ["//hs-cimple:__subpackages__"],
deps = [
hazel_library("aeson"),
hazel_library("array"),
hazel_library("base"),
],
)
happy_parser(
name = "Parser",
src = "src/Language/Cimple/Parser.y",
preproc = "expand_yacc.pl",
)
haskell_library(
name = "parser",
srcs = [
"src/Language/Cimple/AST.hs",
"src/Language/Cimple/Parser.hs",
],
src_strip_prefix = "src",
visibility = ["//hs-cimple:__subpackages__"],
deps = [
":lexer",
hazel_library("aeson"),
hazel_library("array"),
hazel_library("base"),
hazel_library("data-fix"),
hazel_library("transformers-compat"),
],
)
happy_parser(
name = "TreeParser",
src = "src/Language/Cimple/TreeParser.y",
preproc = "expand_yacc.pl",
)
haskell_library(
name = "tree_parser",
srcs = ["src/Language/Cimple/TreeParser.hs"],
src_strip_prefix = "src",
visibility = ["//hs-cimple:__subpackages__"],
deps = [
":lexer",
":parser",
hazel_library("array"),
hazel_library("base"),
hazel_library("data-fix"),
hazel_library("text"),
],
)
haskell_library(
name = "hs-cimple",
srcs = glob(
["src/**/*.*hs"],
exclude = [
"src/Language/Cimple/AST.hs",
"src/Language/Cimple/Tokens.hs",
],
),
src_strip_prefix = "src",
version = "0.0.5",
visibility = ["//visibility:public"],
deps = [
":lexer",
":parser",
":tree_parser",
hazel_library("aeson"),
hazel_library("ansi-wl-pprint"),
hazel_library("array"),
hazel_library("base"),
hazel_library("bytestring"),
hazel_library("containers"),
hazel_library("data-fix"),
hazel_library("filepath"),
hazel_library("groom"),
hazel_library("mtl"),
hazel_library("text"),
],
)
hspec_test(
name = "testsuite",
size = "small",
deps = [
":hs-cimple",
hazel_library("ansi-wl-pprint"),
hazel_library("base"),
hazel_library("data-fix"),
hazel_library("hspec"),
hazel_library("text"),
],
)