Expand description
Import statement parser (get).
Handles all four import forms in rl-lang:
// 1. single file module
get mymodule
// 2. file module with path
get mymodule::utils
// 3. stdlib function
get std::math::sin
// 4. named imports from a module or stdlib
get sin, cos from std::math
get add, sub from mymodule::utilsThe first token after get and whether :: or from follows determines
which StatementKind variant is produced:
| syntax | kind |
|---|---|
get mod | StatementKind::ImportFile |
get mod::sub | StatementKind::ImportFile |
get std::ns::fn | StatementKind::Import |
get fn, fn from std::ns | StatementKind::Import |
get fn, fn from mod::sub | StatementKind::ImportFileNamed |