@@ -117,6 +117,7 @@ fn runtime_function_parameter_to_token(
117
117
let documentation = translation_to_token ( param. documentation ) ;
118
118
119
119
let quote = quote ! {
120
+ /*
120
121
tucana::shared::RuntimeParameterDefinition {
121
122
runtime_name: String::from(#runtime_name),
122
123
data_type_identifier: String::from(#data_type_identifier),
@@ -125,6 +126,7 @@ fn runtime_function_parameter_to_token(
125
126
description: vec![#(#description),*],
126
127
documentation: vec![#(#documentation),*]
127
128
}
129
+ */
128
130
} ;
129
131
130
132
result. push ( quote) ;
@@ -137,7 +139,7 @@ fn runtime_function_definition_to_token(definition: RuntimeFunctionDefinition) -
137
139
let runtime_parameter_definitions =
138
140
runtime_function_parameter_to_token ( definition. runtime_parameter_definitions ) ;
139
141
140
- let return_type_identifier = definition. return_type_identifier . into_token_stream ( ) ;
142
+ // let return_type_identifier = definition.return_type_identifier.into_token_stream();
141
143
142
144
let error_type_identifiers = definition
143
145
. error_type_identifiers
@@ -159,7 +161,7 @@ fn runtime_function_definition_to_token(definition: RuntimeFunctionDefinition) -
159
161
tucana:: shared:: RuntimeFunctionDefinition {
160
162
runtime_name: String :: from( #runtime_name) ,
161
163
runtime_parameter_definitions: vec![ #( #runtime_parameter_definitions) , * ] ,
162
- return_type_identifier: Option :: Some ( String :: from( #return_type_identifier) ) ,
164
+ // return_type_identifier: Option::Some(String::from(#return_type_identifier)),
163
165
error_type_identifiers: vec![ #( #error_type_identifiers) , * ] ,
164
166
name: vec![ #( #name) , * ] ,
165
167
description: vec![ #( #description) , * ] ,
@@ -169,9 +171,9 @@ fn runtime_function_definition_to_token(definition: RuntimeFunctionDefinition) -
169
171
}
170
172
}
171
173
fn main ( ) {
172
- let mut file = File :: create ( "./out/output.rs" ) . expect ( "msg" ) ;
174
+ // let mut file = File::create("./out/output.rs").expect("msg");
173
175
174
- let path = "./definitions/runtime_functions/primitive/boolean .md" ;
176
+ let path = "./definitions/runtime_functions/array/array .md" ;
175
177
let file_content = read_to_string ( path) . unwrap ( ) ;
176
178
let mut lines = file_content. split ( "\n " ) ;
177
179
let mut inside_code_block = false ;
@@ -198,9 +200,20 @@ fn main() {
198
200
}
199
201
}
200
202
201
- let results = code_blocks
202
- . iter ( )
203
- . map ( |f| serde_json:: from_str :: < RuntimeFunctionDefinition > ( f) ) ;
203
+ for code in code_blocks {
204
+ match serde_json:: from_str :: < RuntimeFunctionDefinition > ( & code) {
205
+ Ok ( def) => {
206
+ // let quote = runtime_function_definition_to_token(def);
207
+ // write!(file, "{},", quote).expect("Cannot write to file");
208
+ }
209
+ Err ( err) => {
210
+ print_on_build ! ( "Error parsing JSON: {:?}" , err) ;
211
+ print_on_build ! ( "JSON: {:?}" , code) ;
212
+ }
213
+ }
214
+ }
215
+
216
+ /*
204
217
write!(
205
218
file,
206
219
"pub mod output {{ fn getDefinitions() -> Vec<tucana::shared::RuntimeFunctionDefinition> {{ vec!["
@@ -225,4 +238,5 @@ fn main() {
225
238
.arg("./out/output.rs")
226
239
.arg("--edition")
227
240
.arg("2024");
241
+ */
228
242
}
0 commit comments