Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cl/_testspx/static-member-classfile-basic/Rect.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const .name = "rect"
var (
.count int = 100
Rect.total int = 200
)

func Get() string {
return name
}

func Inc() {
count++
Rect.total++
}
17 changes: 17 additions & 0 deletions cl/_testspx/static-member-classfile-basic/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

const XGos_Rect_Name = "rect"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be XGos_Rect_name


type Rect struct {
}

var XGos_Rect_Count int = 100

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be XGos_Rect_count

var XGos_Rect_Total int = 200

func (this *Rect) Get() string {
return XGos_Rect_Name
}
func (this *Rect) Inc() {
XGos_Rect_Count++
XGos_Rect_Total++
}
8 changes: 8 additions & 0 deletions cl/_testspx/static-member-classfile-before-fields/Rect.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var (
.count int = 100
width int = 10
)

func Get() int {
return width
}
15 changes: 15 additions & 0 deletions cl/_testspx/static-member-classfile-before-fields/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

type Rect struct {
width int
}

var XGos_Rect_Count int = 100

func (this *Rect) Get() int {
return this.width
}
func (this *Rect) XGo_Init() *Rect {
this.width = 10
return this
}
7 changes: 7 additions & 0 deletions cl/_testspx/static-member-classfile-mixed-field/Rect.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var (
Rect.total, width int = 200, 10
)

func Get() int {
return width + Rect.total
}
15 changes: 15 additions & 0 deletions cl/_testspx/static-member-classfile-mixed-field/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

type Rect struct {
width int
}

var XGos_Rect_Total int = 200

func (this *Rect) Get() int {
return this.width + XGos_Rect_Total
}
func (this *Rect) XGo_Init() *Rect {
this.width = 10
return this
}
7 changes: 7 additions & 0 deletions cl/_testxgo/static-member-basic/in.xgo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type foo int

const foo.name = "xgo"
var foo.count int = 100

a := foo.name
foo.count++
12 changes: 12 additions & 0 deletions cl/_testxgo/static-member-basic/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

type foo int

const XGos_foo_Name = "xgo"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be XGos_foo_name


var XGos_foo_Count int = 100

func main() {
a := XGos_foo_Name
XGos_foo_Count++
}
12 changes: 12 additions & 0 deletions cl/_testxgo/static-member-forward-ref/in.xgo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type foo int

func Name() string {
return foo.name
}

func Inc() {
foo.count++
}

const foo.name = "xgo"
var foo.count int = 100
14 changes: 14 additions & 0 deletions cl/_testxgo/static-member-forward-ref/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

type foo int

const XGos_foo_Name = "xgo"

func Name() string {
return XGos_foo_Name
}
func Inc() {
XGos_foo_Count++
}

var XGos_foo_Count int = 100
7 changes: 7 additions & 0 deletions cl/_testxgo/static-member-receiver-after/in.xgo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const foo.name = "xgo"
var foo.count int = 100

type foo int

a := foo.name
foo.count++
12 changes: 12 additions & 0 deletions cl/_testxgo/static-member-receiver-after/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

const XGos_foo_Name = "xgo"

type foo int

var XGos_foo_Count int = 100

func main() {
a := XGos_foo_Name
XGos_foo_Count++
}
11 changes: 11 additions & 0 deletions cl/_testxgo/static-member-selector-shadow/in.xgo
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type foo struct {
name string
count int
}

const foo.name = "static"
var foo.count int = 100

foo := foo{name: "local"}
a := foo.name
foo.count++
16 changes: 16 additions & 0 deletions cl/_testxgo/static-member-selector-shadow/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

type foo struct {
name string
count int
}

const XGos_foo_Name = "static"

var XGos_foo_Count int = 100

func main() {
foo := foo{name: "local"}
a := foo.name
foo.count++
}
5 changes: 5 additions & 0 deletions cl/_testxgo/static-member-unicode/in.xgo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type foo int

const foo.π = 3

a := foo.π
9 changes: 9 additions & 0 deletions cl/_testxgo/static-member-unicode/out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

type foo int

const XGos_foo_Π = 3

func main() {
a := XGos_foo_Π
}
Loading
Loading