-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to get everything working again at the same time
- Loading branch information
Showing
9 changed files
with
55 additions
and
119 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
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,33 +1,21 @@ | ||
#------------------------------------------------------------------------------- | ||
# Matcheroni C lexer demo | ||
|
||
rules = imports.rules | ||
config = imports.config | ||
|
||
c_lexer_lib = rules.cpp_lib( | ||
c_lexer = imports.rules.cpp_lib( | ||
name = "c_lexer", | ||
in_srcs = ["CLexer.cpp", "CToken.cpp"], | ||
out_lib = "c_lexer.a", | ||
**config, | ||
) | ||
|
||
rules.c_test( | ||
imports.rules.c_test( | ||
name = "c_lexer_test", | ||
in_srcs = "c_lexer_test.cpp", | ||
in_libs = c_lexer_lib, | ||
out_bin = "{name}", | ||
quiet = True, | ||
**config, | ||
#debug = True, | ||
#trace = True | ||
in_libs = c_lexer, | ||
) | ||
|
||
rules.cpp_bin( | ||
imports.rules.cpp_bin( | ||
name = "c_lexer_benchmark", | ||
in_srcs = "c_lexer_benchmark.cpp", | ||
in_libs = c_lexer_lib, | ||
out_bin = "c_lexer_benchmark", | ||
**config, | ||
in_libs = c_lexer, | ||
) | ||
|
||
exports.lib = c_lexer_lib | ||
exports.lib = c_lexer |
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,31 +1,22 @@ | ||
#------------------------------------------------------------------------------- | ||
# C parser example (not finished) | ||
|
||
rules = imports.rules | ||
config = imports.config | ||
c_lexer = imports.c_lexer | ||
|
||
c_parser_lib = rules.cpp_lib( | ||
name = "c_parser_lib", | ||
c_parser = imports.rules.cpp_lib( | ||
name = "c_parser", | ||
in_srcs = ["CContext.cpp", "CNode.cpp", "CScope.cpp"], | ||
out_lib = "c_parser.a", | ||
**config, | ||
) | ||
|
||
rules.cpp_bin( | ||
imports.rules.cpp_bin( | ||
name = "c_parser_benchmark", | ||
in_srcs = "c_parser_benchmark.cpp", | ||
in_libs = [c_lexer.lib, c_parser_lib], | ||
out_bin = "c_parser_benchmark", | ||
**config, | ||
in_libs = [imports.c_lexer.lib, c_parser], | ||
) | ||
|
||
# Broken? | ||
#rules.c_test( | ||
# "c_parser_test.cpp", | ||
# "c_parser_test", | ||
# libs = [c_lexer.c_lexer_lib, c_parser_lib], | ||
# quiet = True | ||
#) | ||
|
||
exports.lib = c_parser_lib | ||
exports.lib = c_parser |
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,47 +1,33 @@ | ||
#------------------------------------------------------------------------------- | ||
# Matcheroni JSON parser example | ||
|
||
rules = imports.rules | ||
config = imports.config | ||
|
||
json_parser = rules.cpp_lib( | ||
json_parser = imports.rules.cpp_lib( | ||
name = "json_parser", | ||
in_srcs = ["json_matcher.cpp", "json_parser.cpp"], | ||
out_lib = "json_parser.a", | ||
**config, | ||
) | ||
|
||
rules.cpp_bin( | ||
imports.rules.cpp_bin( | ||
name = "json_conformance", | ||
in_srcs = "json_conformance.cpp", | ||
in_libs = json_parser, | ||
out_bin = "json_conformance", | ||
**config, | ||
) | ||
|
||
rules.cpp_bin( | ||
imports.rules.cpp_bin( | ||
name = "json_benchmark", | ||
in_srcs = "json_benchmark.cpp", | ||
in_libs = json_parser, | ||
out_bin = "json_benchmark", | ||
**config, | ||
) | ||
|
||
rules.cpp_bin( | ||
imports.rules.cpp_bin( | ||
name = "json_demo", | ||
in_srcs = "json_demo.cpp", | ||
in_libs = json_parser, | ||
out_bin = "json_demo", | ||
**config, | ||
) | ||
|
||
rules.c_test( | ||
imports.rules.c_test( | ||
name = "json_test", | ||
in_srcs = "json_test.cpp", | ||
in_libs = json_parser, | ||
out_bin = "json_test", | ||
**config, | ||
quiet = True | ||
) | ||
|
||
exports.lib = json_parser |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
#------------------------------------------------------------------------------- | ||
# TOML parser example | ||
|
||
rules = imports.rules | ||
config = imports.config | ||
|
||
toml_lib = rules.cpp_lib( | ||
toml_parser = imports.rules.cpp_lib( | ||
name = "toml_parser", | ||
in_srcs = "toml_parser.cpp", | ||
out_lib = "toml_lib.a", | ||
**config, | ||
) | ||
|
||
rules.c_test( | ||
imports.rules.c_test( | ||
name = "toml_test", | ||
in_srcs = "toml_test.cpp", | ||
in_libs = toml_lib, | ||
out_bin = "toml_test", | ||
quiet = True, | ||
**config, | ||
in_libs = toml_parser, | ||
) |
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,22 +1,22 @@ | ||
#------------------------------------------------------------------------------- | ||
# Tutorial examples | ||
|
||
rules = imports.rules | ||
config = imports.config | ||
import hancho | ||
|
||
config.command_path = "{repo_path}" | ||
config.quiet = True | ||
config = hancho.Config( | ||
command_path = "{repo_path}", | ||
) | ||
|
||
rules.c_test(config, in_srcs = "json_tut0a.cpp", out_bin = "json_tut0a") | ||
rules.c_test(config, in_srcs = "json_tut1a.cpp", out_bin = "json_tut1a") | ||
rules.c_test(config, in_srcs = "json_tut1b.cpp", out_bin = "json_tut1b") | ||
rules.c_test(config, in_srcs = "json_tut1c.cpp", out_bin = "json_tut1c") | ||
rules.c_test(config, in_srcs = "json_tut2a.cpp", out_bin = "json_tut2a") | ||
rules.c_test(config, in_srcs = "json_tut2b.cpp", out_bin = "json_tut2b") | ||
imports.rules.c_test(config, name = "json_tut0a", in_srcs = "json_tut0a.cpp") | ||
imports.rules.c_test(config, name = "json_tut1a", in_srcs = "json_tut1a.cpp") | ||
imports.rules.c_test(config, name = "json_tut1b", in_srcs = "json_tut1b.cpp") | ||
imports.rules.c_test(config, name = "json_tut1c", in_srcs = "json_tut1c.cpp") | ||
imports.rules.c_test(config, name = "json_tut2a", in_srcs = "json_tut2a.cpp") | ||
imports.rules.c_test(config, name = "json_tut2b", in_srcs = "json_tut2b.cpp") | ||
|
||
rules.c_binary( | ||
imports.rules.cpp_bin( | ||
config, | ||
name = "tiny_c_parser", | ||
in_srcs = "tiny_c_parser.cpp", | ||
out_bin = "tiny_c_parser", | ||
libs = [imports.c_lexer.lib, imports.c_parser.lib], | ||
in_libs = [imports.c_lexer.lib, imports.c_parser.lib], | ||
) |
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,22 +1,16 @@ | ||
#------------------------------------------------------------------------------- | ||
# Tests | ||
|
||
import hancho | ||
|
||
#build obj/matcheroni/Matcheroni.hpp.iwyu : iwyu matcheroni/Matcheroni.hpp | ||
#build obj/matcheroni/Parseroni.hpp.iwyu : iwyu matcheroni/Parseroni.hpp | ||
#build obj/matcheroni/Utilities.hpp.iwyu : iwyu matcheroni/Utilities.hpp | ||
|
||
imports.rules.c_test( | ||
imports.config, | ||
name = "matcheroni_test", | ||
in_srcs = "matcheroni_test.cpp", | ||
out_bin = "matcheroni_test", | ||
quiet = True, | ||
) | ||
|
||
imports.rules.c_test( | ||
imports.config, | ||
name = "parseroni_test", | ||
in_srcs = "parseroni_test.cpp", | ||
out_bin = "parseroni_test", | ||
quiet = True, | ||
) |