Skip to content

Commit

Permalink
Merge pull request #148 from davidzchen/bazel-fix
Browse files Browse the repository at this point in the history
Fix Bazel build targets
  • Loading branch information
sparkprime committed Mar 29, 2016
2 parents ce85fb9 + d38bffe commit 6b2fe56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
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

0 comments on commit 6b2fe56

Please sign in to comment.