get method
Get the last node associated with a specific label
.
For example, for pattern {@code
Pattern tags like {@code
@param label The label to check.
@return The last ParseTree to match a tag with the specified label, or null if no parse tree matched a tag with the label.
Implementation
ParseTree? get(String label) {
final parseTrees = labels[label];
if (parseTrees == null || parseTrees.isEmpty) {
return null;
}
return parseTrees[parseTrees.length - 1]; // return last if multiple
}