Appearance
| 1 | namespace Semantic is | |
| 2 | use IO.Std; | |
| 3 | ||
| 4 | use Symbols.Symbol; | |
| 5 | ||
| 6 | class SYMBOL_WRAPPER(symbol: Symbol) is | |
| 7 | _hash: int; | |
| 8 | _root_symbol: Symbol; | |
| 9 | ||
| 10 | equals(other: object?) -> bool => | |
| 11 | if !other? then | |
| 12 | false; | |
| 13 | elif !isa SYMBOL_WRAPPER(other) then | |
| 14 | false; | |
| 15 | else | |
| 16 | self =~ other; | |
| 17 | fi; | |
| 18 | ||
| 19 | =~(other: SYMBOL_WRAPPER) -> bool => | |
| 20 | _root_symbol == other._root_symbol; | |
| 21 | ||
| 22 | init(..) is | |
| 23 | _root_symbol = symbol.root_specialized_from; | |
| 24 | _hash = _root_symbol.get_hash_code(); | |
| 25 | si | |
| 26 | ||
| 27 | get_hash_code() -> int => _hash; | |
| 28 | ||
| 29 | to_string() -> string => "{symbol}"; | |
| 30 | si | |
| 31 | si |