Lines Matching defs:source
99 let source = match read_to_string(path) {
100 Ok(source) => source,
103 match generate_from_string(&source, opt) {
105 Err(err) => format_err(path, &source, err),
121 fn generate_from_string(source: &str, opt: &Opt) -> Result<GeneratedCode> {
122 let mut source = source;
123 if source.starts_with("#!") && !source.starts_with("#![") {
124 let shebang_end = source.find('\n').unwrap_or(source.len());
125 source = &source[shebang_end..];
128 let syntax: File = syn::parse_str(source)?;