@tishlang/tish-format 1.0.12 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +51 -0
- package/LICENSE +13 -0
- package/bin/tish-format +0 -0
- package/crates/js_to_tish/Cargo.toml +11 -0
- package/crates/js_to_tish/README.md +18 -0
- package/crates/js_to_tish/src/error.rs +55 -0
- package/crates/js_to_tish/src/lib.rs +11 -0
- package/crates/js_to_tish/src/span_util.rs +35 -0
- package/crates/js_to_tish/src/transform/expr.rs +611 -0
- package/crates/js_to_tish/src/transform/stmt.rs +503 -0
- package/crates/js_to_tish/src/transform.rs +60 -0
- package/crates/tish/Cargo.toml +62 -0
- package/crates/tish/build.rs +21 -0
- package/crates/tish/src/cargo_native_registry.rs +32 -0
- package/crates/tish/src/cli_help.rs +576 -0
- package/crates/tish/src/main.rs +853 -0
- package/crates/tish/src/repl_completion.rs +199 -0
- package/crates/tish/tests/cargo_example_compile.rs +67 -0
- package/crates/tish/tests/error_source_location.rs +36 -0
- package/crates/tish/tests/fixtures/cargo_example_project/Cargo.toml +3 -0
- package/crates/tish/tests/fixtures/cargo_example_project/crates/demo-shim/Cargo.toml +11 -0
- package/crates/tish/tests/fixtures/cargo_example_project/crates/demo-shim/src/lib.rs +12 -0
- package/crates/tish/tests/fixtures/cargo_example_project/package.json +10 -0
- package/crates/tish/tests/fixtures/cargo_example_project/src/main.tish +3 -0
- package/crates/tish/tests/fixtures/runtime_error_location.tish +5 -0
- package/crates/tish/tests/fixtures/trycatch_runtime_errors.tish +15 -0
- package/crates/tish/tests/fixtures/tty_capability.tish +9 -0
- package/crates/tish/tests/integration_test.rs +1406 -0
- package/crates/tish/tests/run_optimize_stdout_parity.rs +50 -0
- package/crates/tish/tests/shortcircuit.rs +65 -0
- package/crates/tish/tests/trycatch_runtime_errors.rs +45 -0
- package/crates/tish/tests/tty_capability.rs +43 -0
- package/crates/tish_ast/Cargo.toml +9 -0
- package/crates/tish_ast/src/ast.rs +649 -0
- package/crates/tish_ast/src/lib.rs +5 -0
- package/crates/tish_build_utils/Cargo.toml +11 -0
- package/crates/tish_build_utils/src/lib.rs +577 -0
- package/crates/tish_builtins/Cargo.toml +22 -0
- package/crates/tish_builtins/src/array.rs +803 -0
- package/crates/tish_builtins/src/collections.rs +481 -0
- package/crates/tish_builtins/src/construct.rs +199 -0
- package/crates/tish_builtins/src/date.rs +538 -0
- package/crates/tish_builtins/src/globals.rs +293 -0
- package/crates/tish_builtins/src/helpers.rs +35 -0
- package/crates/tish_builtins/src/iterator.rs +129 -0
- package/crates/tish_builtins/src/lib.rs +21 -0
- package/crates/tish_builtins/src/math.rs +89 -0
- package/crates/tish_builtins/src/number.rs +96 -0
- package/crates/tish_builtins/src/object.rs +36 -0
- package/crates/tish_builtins/src/string.rs +646 -0
- package/crates/tish_builtins/src/symbol.rs +83 -0
- package/crates/tish_builtins/src/typedarrays.rs +298 -0
- package/crates/tish_bytecode/Cargo.toml +17 -0
- package/crates/tish_bytecode/src/chunk.rs +164 -0
- package/crates/tish_bytecode/src/compiler.rs +2604 -0
- package/crates/tish_bytecode/src/encoding.rs +102 -0
- package/crates/tish_bytecode/src/lib.rs +20 -0
- package/crates/tish_bytecode/src/opcode.rs +185 -0
- package/crates/tish_bytecode/src/peephole.rs +189 -0
- package/crates/tish_bytecode/src/serialize.rs +193 -0
- package/crates/tish_bytecode/tests/break_continue_bytecode.rs +44 -0
- package/crates/tish_bytecode/tests/constant_folding.rs +84 -0
- package/crates/tish_bytecode/tests/sort_optimization.rs +31 -0
- package/crates/tish_compile/Cargo.toml +27 -0
- package/crates/tish_compile/src/check.rs +774 -0
- package/crates/tish_compile/src/codegen.rs +7317 -0
- package/crates/tish_compile/src/infer.rs +1681 -0
- package/crates/tish_compile/src/lib.rs +206 -0
- package/crates/tish_compile/src/resolve.rs +1951 -0
- package/crates/tish_compile/src/types.rs +605 -0
- package/crates/tish_compile_js/Cargo.toml +18 -0
- package/crates/tish_compile_js/examples/jsx_vdom_smoke.tish +8 -0
- package/crates/tish_compile_js/src/codegen.rs +938 -0
- package/crates/tish_compile_js/src/error.rs +20 -0
- package/crates/tish_compile_js/src/lib.rs +26 -0
- package/crates/tish_compile_js/src/tests_jsx.rs +414 -0
- package/crates/tish_compiler_wasm/Cargo.toml +21 -0
- package/crates/tish_compiler_wasm/src/lib.rs +57 -0
- package/crates/tish_compiler_wasm/src/resolve_virtual.rs +473 -0
- package/crates/tish_core/Cargo.toml +32 -0
- package/crates/tish_core/src/console_style.rs +170 -0
- package/crates/tish_core/src/json.rs +430 -0
- package/crates/tish_core/src/lib.rs +20 -0
- package/crates/tish_core/src/macros.rs +36 -0
- package/crates/tish_core/src/shape.rs +85 -0
- package/crates/tish_core/src/uri.rs +118 -0
- package/crates/tish_core/src/value.rs +1350 -0
- package/crates/tish_core/src/vmref.rs +183 -0
- package/crates/tish_cranelift/Cargo.toml +19 -0
- package/crates/tish_cranelift/src/lib.rs +43 -0
- package/crates/tish_cranelift/src/link.rs +130 -0
- package/crates/tish_cranelift/src/lower.rs +85 -0
- package/crates/tish_cranelift_runtime/Cargo.toml +26 -0
- package/crates/tish_cranelift_runtime/src/lib.rs +45 -0
- package/crates/tish_eval/Cargo.toml +51 -0
- package/crates/tish_eval/src/eval.rs +4265 -0
- package/crates/tish_eval/src/http.rs +191 -0
- package/crates/tish_eval/src/lib.rs +99 -0
- package/crates/tish_eval/src/natives.rs +551 -0
- package/crates/tish_eval/src/promise.rs +179 -0
- package/crates/tish_eval/src/regex.rs +299 -0
- package/crates/tish_eval/src/timers.rs +120 -0
- package/crates/tish_eval/src/value.rs +336 -0
- package/crates/tish_eval/src/value_convert.rs +117 -0
- package/crates/tish_ffi/Cargo.toml +26 -0
- package/crates/tish_ffi/src/lib.rs +518 -0
- package/crates/tish_ffi/tests/fixtures/testmod/Cargo.toml +18 -0
- package/crates/tish_ffi/tests/fixtures/testmod/src/lib.rs +46 -0
- package/crates/tish_ffi/tests/loader.rs +65 -0
- package/crates/tish_fmt/Cargo.toml +16 -0
- package/crates/tish_fmt/src/bin/tish-fmt.rs +41 -0
- package/crates/tish_fmt/src/lib.rs +2157 -0
- package/crates/tish_jsx_web/Cargo.toml +9 -0
- package/crates/tish_jsx_web/README.md +5 -0
- package/crates/tish_jsx_web/src/lib.rs +2 -0
- package/crates/tish_lexer/Cargo.toml +9 -0
- package/crates/tish_lexer/src/lib.rs +1104 -0
- package/crates/tish_lexer/src/token.rs +170 -0
- package/crates/tish_lint/Cargo.toml +18 -0
- package/crates/tish_lint/src/bin/tish-lint.rs +195 -0
- package/crates/tish_lint/src/lib.rs +281 -0
- package/crates/tish_llvm/Cargo.toml +13 -0
- package/crates/tish_llvm/src/lib.rs +115 -0
- package/crates/tish_lsp/Cargo.toml +25 -0
- package/crates/tish_lsp/README.md +26 -0
- package/crates/tish_lsp/src/builtin_goto.rs +362 -0
- package/crates/tish_lsp/src/import_goto.rs +564 -0
- package/crates/tish_lsp/src/main.rs +1459 -0
- package/crates/tish_native/Cargo.toml +16 -0
- package/crates/tish_native/src/build.rs +481 -0
- package/crates/tish_native/src/config.rs +48 -0
- package/crates/tish_native/src/lib.rs +416 -0
- package/crates/tish_opt/Cargo.toml +13 -0
- package/crates/tish_opt/src/lib.rs +1046 -0
- package/crates/tish_parser/Cargo.toml +11 -0
- package/crates/tish_parser/src/lib.rs +386 -0
- package/crates/tish_parser/src/parser.rs +2726 -0
- package/crates/tish_pg/Cargo.toml +34 -0
- package/crates/tish_pg/README.md +38 -0
- package/crates/tish_pg/src/error.rs +52 -0
- package/crates/tish_pg/src/lib.rs +955 -0
- package/crates/tish_resolve/Cargo.toml +13 -0
- package/crates/tish_resolve/src/lib.rs +3601 -0
- package/crates/tish_resolve/src/pos.rs +141 -0
- package/crates/tish_runtime/Cargo.toml +100 -0
- package/crates/tish_runtime/src/http.rs +1347 -0
- package/crates/tish_runtime/src/http_fetch.rs +492 -0
- package/crates/tish_runtime/src/http_hyper.rs +441 -0
- package/crates/tish_runtime/src/http_prefork.rs +189 -0
- package/crates/tish_runtime/src/lib.rs +1447 -0
- package/crates/tish_runtime/src/native_promise.rs +15 -0
- package/crates/tish_runtime/src/promise.rs +558 -0
- package/crates/tish_runtime/src/promise_io.rs +38 -0
- package/crates/tish_runtime/src/timers.rs +172 -0
- package/crates/tish_runtime/src/tty.rs +226 -0
- package/crates/tish_runtime/src/ws.rs +778 -0
- package/crates/tish_runtime/tests/fetch_readable_stream.rs +102 -0
- package/crates/tish_ui/Cargo.toml +17 -0
- package/crates/tish_ui/src/jsx.rs +692 -0
- package/crates/tish_ui/src/lib.rs +20 -0
- package/crates/tish_ui/src/runtime/hooks.rs +573 -0
- package/crates/tish_ui/src/runtime/mod.rs +183 -0
- package/crates/tish_vm/Cargo.toml +60 -0
- package/crates/tish_vm/src/jit.rs +1050 -0
- package/crates/tish_vm/src/lib.rs +41 -0
- package/crates/tish_vm/src/vm.rs +3536 -0
- package/crates/tish_vm/tests/concurrent_shared_state.rs +140 -0
- package/crates/tish_vm/tests/fixtures/or_string_cmd.tish +2 -0
- package/crates/tish_vm/tests/lexical_scope_declare.rs +34 -0
- package/crates/tish_vm/tests/peephole_jump_chain_logical_or.rs +150 -0
- package/crates/tish_wasm/Cargo.toml +15 -0
- package/crates/tish_wasm/src/lib.rs +428 -0
- package/crates/tish_wasm_runtime/Cargo.toml +37 -0
- package/crates/tish_wasm_runtime/src/gpu.rs +429 -0
- package/crates/tish_wasm_runtime/src/lib.rs +42 -0
- package/crates/tishlang_cargo_bindgen/Cargo.toml +26 -0
- package/crates/tishlang_cargo_bindgen/src/classify.rs +261 -0
- package/crates/tishlang_cargo_bindgen/src/discover.rs +125 -0
- package/crates/tishlang_cargo_bindgen/src/infer.rs +382 -0
- package/crates/tishlang_cargo_bindgen/src/lib.rs +349 -0
- package/crates/tishlang_cargo_bindgen/src/main.rs +167 -0
- package/crates/tishlang_cargo_bindgen/src/metadata.rs +117 -0
- package/justfile +276 -0
- package/package.json +2 -2
- package/platform/darwin-arm64/tish-fmt +0 -0
- package/platform/darwin-x64/tish-fmt +0 -0
- package/platform/linux-arm64/tish-fmt +0 -0
- package/platform/linux-x64/tish-fmt +0 -0
- package/platform/win32-x64/tish-fmt.exe +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
//! Native compiler backend for Tish.
|
|
2
|
+
//!
|
|
3
|
+
//! Emits Rust source that links to tishlang_runtime.
|
|
4
|
+
|
|
5
|
+
mod check;
|
|
6
|
+
mod codegen;
|
|
7
|
+
mod infer;
|
|
8
|
+
mod resolve;
|
|
9
|
+
mod types;
|
|
10
|
+
|
|
11
|
+
pub use check::{check_program, TypeDiagnostic};
|
|
12
|
+
|
|
13
|
+
/// How generated Rust is linked (desktop binary vs embedded iOS staticlib).
|
|
14
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
|
15
|
+
pub enum NativeEmitMode {
|
|
16
|
+
#[default]
|
|
17
|
+
DesktopBin,
|
|
18
|
+
/// `[lib] crate-type = ["staticlib"]` — no `fn main()`, host calls `tish_ios_launch`.
|
|
19
|
+
EmbeddedLib,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
pub use codegen::CompileError;
|
|
23
|
+
pub use codegen::{
|
|
24
|
+
compile, compile_project, compile_project_full, compile_project_full_emit,
|
|
25
|
+
compile_with_features, compile_with_native_modules, compile_with_native_modules_emit,
|
|
26
|
+
compile_with_project_root,
|
|
27
|
+
};
|
|
28
|
+
pub use resolve::{
|
|
29
|
+
cargo_export_fn_name, compute_native_build_artifacts, detect_cycles, ensure_tish_canvas_module,
|
|
30
|
+
export_name_to_rust_ident, extract_native_import_features, format_rust_dependencies_toml,
|
|
31
|
+
generate_native_wrapper_rs, has_external_native_imports, has_native_imports,
|
|
32
|
+
ffi_native_specs, infer_native_module_exports, is_builtin_native_spec, is_cargo_native_spec,
|
|
33
|
+
is_ffi_native_spec, is_native_import,
|
|
34
|
+
merge_modules, normalize_builtin_spec, program_uses_document, read_project_tish_config,
|
|
35
|
+
resolve_bare_spec, resolve_native_modules, resolve_project, resolve_project_from_stdin,
|
|
36
|
+
MergedProgram, NativeBuildArtifacts, NativeModuleInit, ResolvedNativeModule,
|
|
37
|
+
};
|
|
38
|
+
pub use types::{RustType, TypeContext};
|
|
39
|
+
|
|
40
|
+
#[cfg(test)]
|
|
41
|
+
mod tests {
|
|
42
|
+
use super::*;
|
|
43
|
+
use tishlang_parser::parse;
|
|
44
|
+
|
|
45
|
+
#[test]
|
|
46
|
+
fn typed_assign_conversion() {
|
|
47
|
+
// Typed rest-param `...args: number[]` lowers to a native `Vec<f64>` (M3), so the ForOf
|
|
48
|
+
// element `n` is `f64`, `total = total + n` stays native, and `total` is NOT demoted — the
|
|
49
|
+
// whole reduction compiles to native f64 with the return wrapping `total` back to `Value`.
|
|
50
|
+
let src = r#"
|
|
51
|
+
fn sum(...args: number[]): number {
|
|
52
|
+
let total: number = 0
|
|
53
|
+
for (let n of args) { total = total + n }
|
|
54
|
+
return total
|
|
55
|
+
}
|
|
56
|
+
"#;
|
|
57
|
+
let program = parse(src).unwrap();
|
|
58
|
+
let rust = compile(&program).unwrap();
|
|
59
|
+
assert!(
|
|
60
|
+
rust.contains("let mut total: f64"),
|
|
61
|
+
"typed rest-param `Vec<f64>` keeps `total` native f64 (no demotion)"
|
|
62
|
+
);
|
|
63
|
+
assert!(
|
|
64
|
+
rust.contains("Value::Number(total)"),
|
|
65
|
+
"f64 total is wrapped back to Value at the return boundary"
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
// When every reassignment is provably numeric, the `number` local stays native `f64` and
|
|
69
|
+
// is wrapped back to `Value` only at the return boundary.
|
|
70
|
+
let src_native = r#"
|
|
71
|
+
fn count(): number {
|
|
72
|
+
let total: number = 0
|
|
73
|
+
for (let i: number = 0; i < 10; i = i + 1) { total = total + i }
|
|
74
|
+
return total
|
|
75
|
+
}
|
|
76
|
+
"#;
|
|
77
|
+
let program = parse(src_native).unwrap();
|
|
78
|
+
let rust = compile(&program).unwrap();
|
|
79
|
+
assert!(
|
|
80
|
+
rust.contains("let mut total: f64"),
|
|
81
|
+
"numeric-only reassignment keeps `total` native f64"
|
|
82
|
+
);
|
|
83
|
+
assert!(
|
|
84
|
+
rust.contains("Value::Number(total)"),
|
|
85
|
+
"f64 total is wrapped back to Value at the return boundary"
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
#[test]
|
|
90
|
+
fn loop_var_decl_clone_outer_var() {
|
|
91
|
+
// With inference, outerVar = 42 gets inferred as f64. f64 is Copy, so no clone is
|
|
92
|
+
// needed — direct assignment is correct. The test verifies compilation succeeds.
|
|
93
|
+
let src = r#"
|
|
94
|
+
let outerVar = 42
|
|
95
|
+
for (let i = 0; i < 5; i = i + 1) {
|
|
96
|
+
let x = outerVar
|
|
97
|
+
}
|
|
98
|
+
"#;
|
|
99
|
+
let program = parse(src).unwrap();
|
|
100
|
+
let rust = compile(&program).unwrap();
|
|
101
|
+
// outerVar and x are f64 (inferred) — Copy assignment, no .clone() needed.
|
|
102
|
+
assert!(
|
|
103
|
+
rust.contains("let mut outerVar: f64"),
|
|
104
|
+
"expected outerVar: f64"
|
|
105
|
+
);
|
|
106
|
+
assert!(rust.contains("let mut x: f64"), "expected x: f64");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
#[test]
|
|
110
|
+
fn new_expression_lowers_to_construct_on_native() {
|
|
111
|
+
let src = "fn f() { return new Uint8Array(4) }";
|
|
112
|
+
let program = parse(src).unwrap();
|
|
113
|
+
let rust = compile(&program).unwrap();
|
|
114
|
+
assert!(
|
|
115
|
+
rust.contains("tish_construct"),
|
|
116
|
+
"expected new to lower to tish_construct, got snippet missing it"
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/// User-defined constructor name: `new ClassName(...)` must compile natively (host `construct`)
|
|
121
|
+
/// and is the same surface syntax as the JS target (`new` in emitted JavaScript).
|
|
122
|
+
#[test]
|
|
123
|
+
fn new_class_name_compiles_native_via_tish_construct() {
|
|
124
|
+
let src = r#"
|
|
125
|
+
fn ClassName(x) {
|
|
126
|
+
return x
|
|
127
|
+
}
|
|
128
|
+
fn factory() {
|
|
129
|
+
return new ClassName(42)
|
|
130
|
+
}
|
|
131
|
+
"#;
|
|
132
|
+
let program = parse(src).unwrap();
|
|
133
|
+
let rust = compile(&program).unwrap();
|
|
134
|
+
assert!(
|
|
135
|
+
rust.contains("tish_construct"),
|
|
136
|
+
"expected new ClassName to lower to tish_construct"
|
|
137
|
+
);
|
|
138
|
+
assert!(
|
|
139
|
+
rust.contains("ClassName"),
|
|
140
|
+
"expected emitted Rust to reference ClassName callable"
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/// `value_call` must take `&Value` to a **local** (`let _callee = (<expr>).clone(); … &_callee`):
|
|
145
|
+
/// `&<temporary>` can dangle in release, and `let _callee = <ident>` would move globals like `Symbol`.
|
|
146
|
+
#[test]
|
|
147
|
+
fn native_emit_value_call_materializes_callee() {
|
|
148
|
+
use std::path::PathBuf;
|
|
149
|
+
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
|
150
|
+
let path = manifest.join("../../tests/core/symbol.tish").canonicalize().unwrap();
|
|
151
|
+
let (rust, _, _, _) = compile_project_full(&path, path.parent(), &[], true).unwrap();
|
|
152
|
+
assert!(
|
|
153
|
+
rust.contains("let _callee = (tishlang_runtime::get_index"),
|
|
154
|
+
"fixture should bracket-call via get_index with callee stored in a local"
|
|
155
|
+
);
|
|
156
|
+
assert!(
|
|
157
|
+
!rust.contains("let _callee = &tishlang_runtime::get_index"),
|
|
158
|
+
"expected callee materialization, found reference-to-temporary pattern"
|
|
159
|
+
);
|
|
160
|
+
assert!(
|
|
161
|
+
rust.contains("tishlang_runtime::value_call"),
|
|
162
|
+
"expected value_call via runtime re-export for nested Cargo builds"
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
#[test]
|
|
167
|
+
fn loop_var_decl_clone_via_project_full() {
|
|
168
|
+
// With the inference pass, `let outerVar = 42` is inferred as f64 (Copy) — no clone needed.
|
|
169
|
+
// This test verifies the full benchmark_granular project compiles and that outerVar
|
|
170
|
+
// is emitted as the inferred f64 type rather than requiring a Value clone.
|
|
171
|
+
let manifest = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
|
172
|
+
let bench = manifest
|
|
173
|
+
.join("../../tests/core/benchmark_granular.tish")
|
|
174
|
+
.canonicalize()
|
|
175
|
+
.unwrap();
|
|
176
|
+
// Use same default features as tish CLI (http, fs, process, regex)
|
|
177
|
+
let features = ["http", "fs", "process", "regex"]
|
|
178
|
+
.into_iter()
|
|
179
|
+
.map(String::from)
|
|
180
|
+
.collect::<Vec<_>>();
|
|
181
|
+
let (rust, _, _, _) =
|
|
182
|
+
compile_project_full(&bench, bench.parent(), &features, true).unwrap();
|
|
183
|
+
// outerVar = 42 is inferred as f64; f64 is Copy so no .clone() is emitted.
|
|
184
|
+
assert!(
|
|
185
|
+
rust.contains("let mut outerVar: f64"),
|
|
186
|
+
"expected outerVar to be inferred as f64 (Copy, no clone needed)"
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
#[cfg(test)]
|
|
192
|
+
mod monomorphization_tests {
|
|
193
|
+
use super::*;
|
|
194
|
+
use tishlang_parser::parse;
|
|
195
|
+
|
|
196
|
+
/// `Box<number>` monomorphizes to a synthetic concrete alias whose field is a native `f64`,
|
|
197
|
+
/// not a boxed `Value` — generic structs participate in native lowering.
|
|
198
|
+
#[test]
|
|
199
|
+
fn generic_struct_is_native() {
|
|
200
|
+
let src = "type Box<T> = { value: T }\nlet b: Box<number> = { value: 42 }\nconsole.log(b.value + 1)";
|
|
201
|
+
let rust = compile(&parse(src).unwrap()).unwrap();
|
|
202
|
+
// Box<number> must monomorphize to a struct with a native f64 field (not Value).
|
|
203
|
+
assert!(rust.contains("value: f64"), "expected native f64 field; got:\n{}",
|
|
204
|
+
rust.lines().filter(|l| l.contains("struct") || l.contains("value")).take(6).collect::<Vec<_>>().join("\n"));
|
|
205
|
+
}
|
|
206
|
+
}
|