Added useful utilities for resolving identidfiers

This commit is contained in:
2022-09-19 12:17:12 -04:00
parent cf18af1995
commit 92ac258dbe
2 changed files with 55 additions and 1 deletions

View File

@@ -65,6 +65,13 @@ func (identifier Identifier) Item (index int) (item string) {
return
}
// Bite removes the first item from the identifier and returns it.
func (identifier *Identifier) Bite () (item string) {
item = identifier.trail[0]
identifier.trail = identifier.trail[1:]
return
}
// Kind returns the type's kind.
func (what Type) Kind () (kind TypeKind) {
kind = what.kind