Parse PHP source text and extract constant names from `define()` calls and top-level `const` statements. Returns a list of `(name, offset, value)` tuples for every `define('NAME', value)` call or `const NAME = value;` statement found at the top level, inside namespace blocks, block statements, or `if` guards.
(&self, content: &str)
| 1187 | /// found at the top level, inside namespace blocks, block statements, |
| 1188 | /// or `if` guards. |
| 1189 | pub fn parse_defines(&self, content: &str) -> Vec<(String, u32, Option<String>)> { |
| 1190 | with_parsed_program(content, "parse_defines", |program, content| { |
| 1191 | let mut defines = Vec::new(); |
| 1192 | Self::extract_defines_from_statements(program.statements.iter(), &mut defines, content); |
| 1193 | defines |
| 1194 | }) |
| 1195 | } |
| 1196 | |
| 1197 | /// Parse PHP source text and extract `use` statement mappings. |
| 1198 | /// |