Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bazel build targets #148

Merged
merged 1 commit into from
Mar 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,20 @@ cc_test(

cc_library(
name = "parser",
srcs = ["parser.cpp"],
hdrs = ["parser.h"],
srcs = [
"desugarer.cpp",
"parser.cpp",
"string_utils.cpp",
],
hdrs = [
"desugarer.h",
"parser.h",
"string_utils.h",
],
deps = [
":common",
":lexer",
"//stdlib:std",
],
)

Expand All @@ -55,23 +64,20 @@ cc_library(
"formatter.cpp",
"libjsonnet.cpp",
"static_analysis.cpp",
"string_utils.cpp",
"vm.cpp",
],
hdrs = [
"desugarer.h",
"formatter.h",
"state.h",
"static_analysis.h",
"string_utils.h",
"vm.h",
],
deps = [
":common",
":lexer",
":parser",
"//include:libjsonnet",
"//stdlib:std",
],
linkopts = ["-lm"],
includes = ["."],
Expand Down
14 changes: 7 additions & 7 deletions core/desugarer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ limitations under the License.
static const Fodder EF; // Empty fodder.

static const LocationRange E; // Empty.

static unsigned long max_builtin = 24;
BuiltinDecl jsonnet_builtin_decl(unsigned long builtin)
{
Expand Down Expand Up @@ -97,7 +97,7 @@ class Desugarer {
Var *std(void)
{ return var(id(U"std")); }


Local::Bind bind(const Identifier *id, AST *body)
{
return Local::Bind(EF, id, EF, body, false, EF, Params{}, false, EF, EF);
Expand All @@ -117,7 +117,7 @@ class Desugarer {
Apply *stdFunc(const String &name, AST *v)
{
return make<Apply>(
v->location,
v->location,
EF,
make<Index>(E, EF, std(), EF, false, str(name), EF, nullptr, EF, nullptr, EF),
EF,
Expand All @@ -132,7 +132,7 @@ class Desugarer {
Apply *stdFunc(const LocationRange &loc, const String &name, AST *a, AST *b)
{
return make<Apply>(
loc,
loc,
EF,
make<Index>(E, EF, std(), EF, false, str(name), EF, nullptr, EF, nullptr, EF),
EF,
Expand Down Expand Up @@ -342,7 +342,7 @@ class Desugarer {
out = make<Apply>( // False branch.
E,
EF,
var(_aux[prev_for]),
var(_aux[prev_for]),
EF,
Apply::Args {
{ make<Binary>(E, EF, var(_i[prev_for]), EF, BOP_PLUS, one), EF, },
Expand Down Expand Up @@ -400,7 +400,7 @@ class Desugarer {
false, // trailingComma
EF,
make<Conditional>(
ast->location,
ast->location,
EF,
make<Binary>(
E, EF, var(_i[i]), EF, BOP_GREATER_EQ, length(var(_l))),
Expand All @@ -419,7 +419,7 @@ class Desugarer {
)
))},
make<Conditional>(
ast->location,
ast->location,
EF,
equals(ast->location, type(var(_l)), str(U"array")),
EF,
Expand Down