An unaliased dotted Python import binds its first component, not its last: * `import xml.etree` introduces `xml`. Keep module_path intact for dependency * resolution while recording the language-correct local spelling. */
| 116 | * `import xml.etree` introduces `xml`. Keep module_path intact for dependency |
| 117 | * resolution while recording the language-correct local spelling. */ |
| 118 | static const char *python_import_root(CBMArena *a, const char *path) { |
| 119 | if (!path) { |
| 120 | return NULL; |
| 121 | } |
| 122 | const char *dot = strchr(path, '.'); |
| 123 | return dot ? cbm_arena_strndup(a, path, (size_t)(dot - path)) : path; |
| 124 | } |
| 125 | |
| 126 | // --- Go imports --- |
| 127 | // import_declaration -> import_spec_list -> import_spec -> (name, path) |
no test coverage detected