docs: public PatternElementMatch getFirstLabeledMatch(String label) {
          PatternElementMatch cur = this, result = null;
          while (cur != null) {
              String elementLabel = cur.patternElement.getLabel();
              if (elementLabel != null && elementLabel.equals(label)) {
                  result = cur;
              }
              cur = cur.prev;
          }
          return result;
      }