Skip to content

Commit

Permalink
checkpoint, just indentation fixes and some minor in_libs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Nov 3, 2024
1 parent e399aac commit 0d12813
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 88 deletions.
28 changes: 14 additions & 14 deletions examples/c_lexer/c_lexer.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
# Matcheroni C lexer demo

lib = hancho(
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = ["CLexer.cpp", "CToken.cpp"],
out_lib = "c_lexer.a",
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = ["CLexer.cpp", "CToken.cpp"],
out_lib = "c_lexer.a",
)

hancho(
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "c_lexer_test.cpp",
in_libs = lib,
out_bin = "c_lexer_test",
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "c_lexer_test.cpp",
in_libs = lib,
out_bin = "c_lexer_test",
)

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "c_lexer_benchmark.cpp",
in_libs = lib,
out_bin = "c_lexer_benchmark",
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "c_lexer_benchmark.cpp",
in_libs = lib,
out_bin = "c_lexer_benchmark",
)
24 changes: 12 additions & 12 deletions examples/c_parser/c_parser.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
# C parser example (not finished)

lib = hancho(
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = ["CContext.cpp", "CNode.cpp", "CScope.cpp"],
out_lib = "c_parser.a",
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = ["CContext.cpp", "CNode.cpp", "CScope.cpp"],
out_lib = "c_parser.a",
)

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "c_parser_benchmark.cpp",
in_libs = [hancho.c_lexer.lib, lib],
out_bin = "c_parser_benchmark",
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "c_parser_benchmark.cpp",
in_libs = [hancho.c_lexer.lib, lib],
out_bin = "c_parser_benchmark",
)

# Broken?
#rules.c_test(
# "c_parser_test.cpp",
# "c_parser_test",
# libs = [c_lexer.c_lexer_lib, c_parser_lib],
# "c_parser_test.cpp",
# "c_parser_test",
# libs = [c_lexer.c_lexer_lib, c_parser_lib],
#)
48 changes: 24 additions & 24 deletions examples/json/json.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@
# Matcheroni JSON parser example

lib = hancho(
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = ["json_matcher.cpp", "json_parser.cpp"],
out_lib = "json_parser.a",
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = ["json_matcher.cpp", "json_parser.cpp"],
out_lib = "json_parser.a",
)

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "json_conformance.cpp",
in_libs = lib,
out_bin = "json_conformance",
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "json_conformance.cpp",
in_libs = lib,
out_bin = "json_conformance",
)

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "json_benchmark.cpp",
in_libs = lib,
out_bin = "json_benchmark",
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "json_benchmark.cpp",
in_libs = lib,
out_bin = "json_benchmark",
)

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "json_demo.cpp",
in_libs = lib,
out_bin = "json_demo",
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "json_demo.cpp",
in_libs = lib,
out_bin = "json_demo",
)

hancho(
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "json_test.cpp",
in_libs = lib,
out_bin = "json_test",
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "json_test.cpp",
in_libs = lib,
out_bin = "json_test",
)
40 changes: 20 additions & 20 deletions examples/regex/regex.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@


lib = hancho(
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = "regex_parser.cpp",
out_lib = "regex_parser.a",
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = "regex_parser.cpp",
out_lib = "regex_parser.a",
)

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "regex_demo.cpp",
in_libs = lib,
out_bin = "regex_demo",
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "regex_demo.cpp",
in_libs = lib,
out_bin = "regex_demo",
)

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "regex_benchmark.cpp",
in_libs = lib,
out_bin = "regex_benchmark",
sys_libs = ["boost_system", "boost_regex"],
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "regex_benchmark.cpp",
in_libs = lib,
out_bin = "regex_benchmark",
sys_libs = ["-lboost_system", "-lboost_regex"],
)

hancho(
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "regex_test.cpp",
in_libs = lib,
out_bin = "regex_test",
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "regex_test.cpp",
in_libs = lib,
out_bin = "regex_test",
)
18 changes: 9 additions & 9 deletions examples/toml/toml.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# TOML parser example

lib = hancho(
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = "toml_parser.cpp",
out_lib = "toml_parser.a",
hancho.base_rules.cpp_lib,
hancho.cpp_config,
in_srcs = "toml_parser.cpp",
out_lib = "toml_parser.a",
)

hancho(
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "toml_test.cpp",
in_libs = lib,
out_bin = "toml_test",
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "toml_test.cpp",
in_libs = lib,
out_bin = "toml_test",
)
10 changes: 5 additions & 5 deletions examples/tutorial/tutorial.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ hancho(hancho.base_rules.cpp_test, hancho.cpp_config, in_srcs = "json_tut2a.cpp"
hancho(hancho.base_rules.cpp_test, hancho.cpp_config, in_srcs = "json_tut2b.cpp", out_bin = "json_tut2b")

hancho(
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "tiny_c_parser.cpp",
in_libs = [hancho.c_lexer.lib, hancho.c_parser.lib],
out_bin = "tiny_c_parser",
hancho.base_rules.cpp_bin,
hancho.cpp_config,
in_srcs = "tiny_c_parser.cpp",
in_libs = [hancho.c_lexer.lib, hancho.c_parser.lib],
out_bin = "tiny_c_parser",
)
8 changes: 4 additions & 4 deletions tests/tests.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#)

hancho(
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "parseroni_test.cpp",
out_bin = "parseroni_test",
hancho.base_rules.cpp_test,
hancho.cpp_config,
in_srcs = "parseroni_test.cpp",
out_bin = "parseroni_test",
)

0 comments on commit 0d12813

Please sign in to comment.