mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Add pkg to ast Func, Struct and TypeExpr nodes
This commit is contained in:
1 parent
10e4936f08
commit
ed03c5943a
16 files changed
+311
-245
No files matched your search
+21
-3
@@ -99,12 +99,30 @@ func (x ID) IsXAssociativeOp() bool { return x.Key().isXOp() && x.IsAssociativeO
|
||||
// "bar"'s. QID[0] may be 0 for a plain "bar".
|
||||
type QID [2]ID
|
||||
|
||||
func (x QID) IsZero() bool { return x == QID{} }
|
||||
|
||||
// Str returns a string form of x.
|
||||
func (x QID) Str(m *Map) string {
|
||||
if x[0] == 0 {
|
||||
return m.ByID(x[1])
|
||||
if x[0] != 0 {
|
||||
return m.ByID(x[0]) + "." + m.ByID(x[1])
|
||||
}
|
||||
return m.ByID(x[0]) + "." + m.ByID(x[1])
|
||||
return m.ByID(x[1])
|
||||
}
|
||||
|
||||
// QQID is a double-qualified ID, such as "receiverPkg.receiverName.funcName".
|
||||
type QQID [3]ID
|
||||
|
||||
func (x QQID) IsZero() bool { return x == QQID{} }
|
||||
|
||||
// Str returns a string form of x.
|
||||
func (x QQID) Str(m *Map) string {
|
||||
if x[0] != 0 {
|
||||
return m.ByID(x[0]) + "." + m.ByID(x[1]) + "." + m.ByID(x[2])
|
||||
}
|
||||
if x[1] != 0 {
|
||||
return m.ByID(x[1]) + "." + m.ByID(x[2])
|
||||
}
|
||||
return m.ByID(x[2])
|
||||
}
|
||||
|
||||
// Token combines an ID and the line number it was seen.
|
||||
|
||||
Reference in new issue
Block a user