Compare commits
2 Commits
790e7e632e
...
c847d2187d
Author | SHA1 | Date | |
---|---|---|---|
|
c847d2187d | ||
|
cb2264977a |
@ -29,6 +29,15 @@ func (parser *ParsingOperation) parseBody () (err error) {
|
|||||||
}
|
}
|
||||||
parser.tree.typeSections[section.name] = section
|
parser.tree.typeSections[section.name] = section
|
||||||
if err != nil { return }
|
if err != nil { return }
|
||||||
|
case "objt":
|
||||||
|
var section *ObjtSection
|
||||||
|
section, err = parser.parseObjtSection()
|
||||||
|
if parser.tree.typeSections == nil {
|
||||||
|
parser.tree.typeSections =
|
||||||
|
make(map[string] *TypeSection)
|
||||||
|
}
|
||||||
|
parser.tree.objtSections[section.name] = section
|
||||||
|
if err != nil { return }
|
||||||
case "face":
|
case "face":
|
||||||
case "enum":
|
case "enum":
|
||||||
case "func":
|
case "func":
|
||||||
|
@ -123,7 +123,7 @@ type ro IntArrayInit:{Int 3}
|
|||||||
`, test)
|
`, test)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestType (test *testing.T) {
|
func TestObjt (test *testing.T) {
|
||||||
checkTree ("../tests/parser/objt",
|
checkTree ("../tests/parser/objt",
|
||||||
`:arf
|
`:arf
|
||||||
---
|
---
|
||||||
@ -144,7 +144,7 @@ type ro ComplexInit:Obj
|
|||||||
394580
|
394580
|
||||||
type ro Init:Obj
|
type ro Init:Obj
|
||||||
ro that:String "hello world"
|
ro that:String "hello world"
|
||||||
ro this:Int
|
ro this:Int
|
||||||
`, test)
|
`, test)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ type SyntaxTree struct {
|
|||||||
|
|
||||||
requires []string
|
requires []string
|
||||||
typeSections map[string] *TypeSection
|
typeSections map[string] *TypeSection
|
||||||
|
objtSections map[string] *ObjtSection
|
||||||
dataSections map[string] *DataSection
|
dataSections map[string] *DataSection
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
:arf
|
:arf
|
||||||
---
|
---
|
||||||
type ro Basic:Obj
|
objt ro Basic:Obj
|
||||||
ro that:Basic
|
ro that:Basic
|
||||||
ro this:Basic
|
ro this:Basic
|
||||||
|
|
||||||
type ro Init:Obj
|
objt ro Init:Obj
|
||||||
ro that:String "hello world"
|
ro that:String "hello world"
|
||||||
ro this:Int 23
|
ro this:Int 23
|
||||||
|
|
||||||
type ro ComplexInit:Obj
|
objt ro ComplexInit:Obj
|
||||||
ro whatever:{Int 3}
|
ro whatever:{Int 3}
|
||||||
230984
|
230984
|
||||||
849 394580
|
849 394580
|
||||||
|
Reference in New Issue
Block a user