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. */
| 111 | * `import xml.etree` introduces `xml`. Keep module_path intact for dependency |
| 112 | * resolution while recording the language-correct local spelling. */ |
| 113 | static const char *python_import_root(CBMArena *a, const char *path) { |
| 114 | if (!path) { |
| 115 | return NULL; |
| 116 | } |
| 117 | const char *dot = strchr(path, '.'); |
| 118 | return dot ? cbm_arena_strndup(a, path, (size_t)(dot - path)) : path; |
| 119 | } |
| 120 | |
| 121 | // --- Go imports --- |
| 122 | // import_declaration -> import_spec_list -> import_spec -> (name, path) |
no test coverage detected