complete and total overhaul like i promised. things are much easier to reason about. still not working yet though.
This commit is contained in:
22
nexgb/xgbgen/size.go
Normal file
22
nexgb/xgbgen/size.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
type Size struct {
|
||||
Expression
|
||||
}
|
||||
|
||||
func newFixedSize(fixed uint) Size {
|
||||
return Size{&Value{v: fixed}}
|
||||
}
|
||||
|
||||
func newExpressionSize(variable Expression) Size {
|
||||
return Size{variable}
|
||||
}
|
||||
|
||||
func (s1 Size) Add(s2 Size) Size {
|
||||
return Size{newBinaryOp("+", s1, s2)}
|
||||
}
|
||||
|
||||
func (s1 Size) Multiply(s2 Size) Size {
|
||||
return Size{newBinaryOp("*", s1, s2)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user