shitty bitfield packing code

This commit is contained in:
adman
2026-03-02 22:24:26 +01:00
parent 085b83cb71
commit 8d1a4b581b
10 changed files with 41961 additions and 41813 deletions
+15 -1
View File
@@ -95,7 +95,7 @@ func NumLit(n int) *ast.BasicLit {
}
func NumLitHex(n int) *ast.BasicLit {
return NumLitStr(fmt.Sprintf("%X", n))
return NumLitStr(fmt.Sprintf("0x%X", n))
}
func NumLitStr(n string) *ast.BasicLit {
@@ -194,6 +194,14 @@ func SubAssign(lhs, rhs ast.Expr) (s *ast.AssignStmt) {
}
}
func OrAssign(lhs, rhs ast.Expr) (s *ast.AssignStmt) {
return &ast.AssignStmt{
Lhs: []ast.Expr{lhs},
Tok: token.OR_ASSIGN,
Rhs: []ast.Expr{rhs},
}
}
func Exprs(exprs ...ast.Expr) []ast.Expr {
return exprs
}
@@ -511,3 +519,9 @@ func LeftShift(lhs, rhs ast.Expr) *ast.BinaryExpr {
Y: rhs,
}
}
func Grouping(e ast.Expr) *ast.ParenExpr {
return &ast.ParenExpr{
X: e,
}
}