Method code for $command_cache.match_shortcut()

[Turn off line numbering]
  1: arg str, @ignore;
  2: var s, match, obj, args;
  3: 
  4: for obj in ([this()] + filter s in (parents()) where (s.has_ancestor($command_cache)) + modules) {
  5:     for s in (obj.shortcut_cache() || []) {
  6:         if ((match = match_pattern(str, s[1])) != 0) {
  7:             args = $command_lib.handle_shortcut_fields(s[2][2], match);
  8:             return ['shortcut, [s[2][1], [str, @args]]];
  9:         }
 10:     }
 11: }
 12: return 0;

// Created 18-Sep-1997 as a part of ColdCore, see: @help Credit

Tlon