-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from sparkprime/extensions
Extend native functions to all primitive types
- Loading branch information
Showing
7 changed files
with
237 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,63 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_library( | ||
name = "common", | ||
name = "libjsonnet", | ||
srcs = [ | ||
"desugarer.cpp", | ||
"formatter.cpp", | ||
"lexer.cpp", | ||
"libjsonnet.cpp", | ||
"parser.cpp", | ||
"static_analysis.cpp", | ||
"string_utils.cpp", | ||
"vm.cpp", | ||
], | ||
hdrs = [ | ||
"ast.h", | ||
"desugarer.h", | ||
"formatter.h", | ||
"json.h", | ||
"lexer.h", | ||
"parser.h", | ||
"state.h", | ||
"static_analysis.h", | ||
"static_error.h", | ||
"string_utils.h", | ||
"unicode.h", | ||
"vm.h", | ||
], | ||
includes = ["."], | ||
) | ||
|
||
cc_library( | ||
name = "lexer", | ||
srcs = ["lexer.cpp"], | ||
hdrs = ["lexer.h"], | ||
deps = [ | ||
":common", | ||
"//include:libjsonnet", | ||
"//stdlib:std", | ||
], | ||
linkopts = ["-lm"], | ||
includes = ["."], | ||
) | ||
|
||
cc_test( | ||
name = "lexer_test", | ||
srcs = ["lexer_test.cpp"], | ||
deps = [ | ||
":lexer", | ||
":libjsonnet", | ||
# Note: On Ubuntu, apt-get install libgtest-dev google-mock | ||
"//external:gtest_main", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "parser", | ||
srcs = [ | ||
"desugarer.cpp", | ||
"parser.cpp", | ||
"string_utils.cpp", | ||
], | ||
hdrs = [ | ||
"desugarer.h", | ||
"parser.h", | ||
"string_utils.h", | ||
], | ||
deps = [ | ||
":common", | ||
":lexer", | ||
"//stdlib:std", | ||
], | ||
includes = [".", "../include"], | ||
) | ||
|
||
cc_test( | ||
name = "parser_test", | ||
srcs = ["parser_test.cpp"], | ||
deps = [ | ||
":parser", | ||
":libjsonnet", | ||
"//external:gtest_main", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "jsonnet-common", | ||
srcs = [ | ||
"desugarer.cpp", | ||
"formatter.cpp", | ||
"libjsonnet.cpp", | ||
"static_analysis.cpp", | ||
"vm.cpp", | ||
], | ||
hdrs = [ | ||
"desugarer.h", | ||
"formatter.h", | ||
"state.h", | ||
"static_analysis.h", | ||
"vm.h", | ||
], | ||
deps = [ | ||
":common", | ||
":lexer", | ||
":parser", | ||
"//include:libjsonnet", | ||
], | ||
linkopts = ["-lm"], | ||
includes = [".", "../include"], | ||
) | ||
|
||
cc_library( | ||
name = "libjsonnet", | ||
srcs = ["libjsonnet.cpp"], | ||
deps = [ | ||
":jsonnet-common", | ||
"//include:libjsonnet", | ||
], | ||
includes = [".", "../include"], | ||
) | ||
|
||
cc_test( | ||
name = "libjsonnet_test", | ||
srcs = ["libjsonnet_test.cpp"], | ||
deps = [ | ||
":jsonnet-common", | ||
":libjsonnet", | ||
"//external:gtest_main", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.