Appearance
| 1 | namespace Semantic is | |
| 2 | use IO.Std | |
| 3 | ||
| 4 | use Collections.MutableMap | |
| 5 | use Collections.LIST | |
| 6 | use Collections.Iterable | |
| 7 | ||
| 8 | use Symbols.Symbol | |
| 9 | ||
| 10 | use Types.Type | |
| 11 | ||
| 12 | class EMPTY_SCOPE(namespace_name: string?): Scope is | |
| 13 | _qualifier: string | |
| 14 | name: string => if let n = namespace_name then n else "" fi | |
| 15 | qualified_name: string => name | |
| 16 | symbols: Iterable[Symbol] => LIST[Symbol]() | |
| 17 | type: Type? => null | |
| 18 | unspecialized_symbol: Symbol? => null | |
| 19 | ||
| 20 | init(..) is | |
| 21 | if name.length > 0 then | |
| 22 | _qualifier = "{name}." | |
| 23 | else | |
| 24 | _qualifier = "" | |
| 25 | fi | |
| 26 | si | |
| 27 | ||
| 28 | qualify(name: string) -> string => "{_qualifier}{name}" | |
| 29 | ||
| 30 | find_direct(name: string) -> Symbol? => null | |
| 31 | find_member(name: string) -> Symbol? => null | |
| 32 | find_enclosing(name: string) -> Symbol? => null | |
| 33 | ||
| 34 | find_direct_matches(prefix: string, results: MutableMap[string,Symbol]) is | |
| 35 | si | |
| 36 | ||
| 37 | find_member_matches(prefix: string, results: MutableMap[string,Symbol]) is | |
| 38 | si | |
| 39 | ||
| 40 | find_enclosing_matches(prefix: string, results: MutableMap[string,Symbol]) is | |
| 41 | si | |
| 42 | ||
| 43 | si | |
| 44 | si |