diff --git a/parser/face.go b/parser/face.go index 3a53381..ca4a3d2 100644 --- a/parser/face.go +++ b/parser/face.go @@ -32,7 +32,7 @@ func (parser *ParsingOperation) parseFaceSection () ( if err != nil { return } err = parser.nextToken(lexer.TokenKindName) if err != nil { return } - section.inherits = parser.token.Value().(string) + section.inherits, err = parser.parseIdentifier() if err != nil { return } err = parser.nextToken(lexer.TokenKindNewline) if err != nil { return } diff --git a/parser/tree-tostring.go b/parser/tree-tostring.go index 114f681..91667d8 100644 --- a/parser/tree-tostring.go +++ b/parser/tree-tostring.go @@ -367,7 +367,7 @@ func (section *FaceSection) ToString (indent int) (output string) { "face ", section.permission.ToString(), " ", section.name, ":", - section.inherits, "\n") + section.inherits.ToString(), "\n") for _, name := range sortMapKeysAlphabetically(section.behaviors) { behavior := section.behaviors[name] diff --git a/parser/tree.go b/parser/tree.go index b91976d..aec04d4 100644 --- a/parser/tree.go +++ b/parser/tree.go @@ -190,7 +190,6 @@ type ObjtSection struct { location file.Location name string - // TODO: make this Identifier instead of Type inherits Identifier permission types.Permission // TODO: order matters here we need to store these in an array @@ -226,8 +225,7 @@ type FaceBehavior struct { type FaceSection struct { location file.Location name string - // TODO: make this Identifier instead of string - inherits string + inherits Identifier permission types.Permission behaviors map[string] FaceBehavior