Skip to content

Instantly share code, notes, and snippets.

@Darthfett
Created November 13, 2011 16:49
Show Gist options
  • Save Darthfett/1362315 to your computer and use it in GitHub Desktop.
Save Darthfett/1362315 to your computer and use it in GitHub Desktop.
print token
void printType(string type) {
if (typeOf[type].length()) {
return;
}
vector<string> matches;
for (int i = 0; i < symbols.size(); i++) {
string base = getBaseType(symbols[i]);
if (base.compare(type) == 0 && symbols[i].compare(type)) { // symbols[i]'s base is type, but isn't actually type
matches.push_back(symbols[i]);
}
}
if (! matches.size()) {
return;
}
cout << type << " : ";
for (int i = 0; i < matches.size(); i++) {
cout << matches[i] << " ";
}
cout << "#";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment