data-section #3

Merged
sashakoshka merged 42 commits from data-section into main 2022-08-17 18:21:20 +00:00
2 changed files with 38 additions and 1 deletions
Showing only changes of commit 3a3c588023 - Show all commits

View File

@ -42,7 +42,6 @@ func quickIdentifier (trail ...string) (identifier Identifier) {
}
func TestMeta (test *testing.T) {
checkTree ("../tests/parser/meta",
`:arf
author "Sasha Koshka"
@ -52,3 +51,37 @@ require "otherModule"
---
`, test)
}
func TestData (test *testing.T) {
checkTree ("../tests/parser/data",
`:arf
---
data wr integer:Int 3202
data wr integerPointer:{Int}
data wr integerArray16:{Int 16}
data wr integerArrayVariable:{Int ...}
data wr integerArrayInitialized:{Int 16}
3948
293
293049
948
912
340
0
2304
0
4785
92
data wr object:Obj
, this 324
, that 2139
data wr nestedObject:Obj
, this
, bird0 324
, bird1 "hello world"
, that
, bird2 123.8439
, bird3 9328.21348239
`, test)
}

View File

@ -175,5 +175,9 @@ func (section *DataSection) ToString (indent int) (output string) {
section.permission.ToString(), " ",
section.name, ":",
section.what.ToString())
// TODO: print out initialization values. if there is only one of them,
// keep it on the same line. if there are more than one, give each its
// own line.
return
}