-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathparser_elements.go
90 lines (70 loc) · 1.46 KB
/
parser_elements.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package kasia
type Element interface {
lnum() int
}
type TxtElem struct {
ln int
txt []byte
}
func (self *TxtElem) lnum() int { return self.ln }
type VarFunElem struct {
ln int
name interface{}
filt bool
fun bool
args []interface{}
next *VarFunElem
}
func (self *VarFunElem) lnum() int { return self.ln }
const (
if_nocmp = iota // if jednoargumentowy
if_eq // rowny
if_ne // nierowy
if_lt // mniejsz
if_le // mniejszy lub rowny
if_gt // wiekszy
if_ge // wiekszy lub rowny
)
type IfElem struct {
ln int
cmp int
arg1 interface{}
arg2 interface{}
true_block []Element
false_block []Element
}
func (self *IfElem) lnum() int { return self.ln }
type ElifElem struct {
ln int
cmp int
arg1 interface{}
arg2 interface{}
}
func (self *ElifElem) lnum() int { return self.ln }
type ElseElem struct {
ln int
}
func (self *ElseElem) lnum() int { return self.ln }
type EndElem struct {
ln int
}
func (self *EndElem) lnum() int { return self.ln }
type ForElem struct {
ln int
iter_inc int
iter string
val string
arg *VarFunElem
iter_block []Element
else_block []Element
}
func (self *ForElem) lnum() int { return self.ln }
type ReturnElem struct {
ln int
}
func (self *ReturnElem) lnum() int { return self.ln }
type DeferElem struct {
ln int
defer_block []Element
}
func (self *DeferElem) lnum() int { return self.ln }