Refactor structures more.
This commit is contained in:
@ -17,18 +17,18 @@
|
||||
vocabulary structures structures definitions
|
||||
|
||||
variable last-align
|
||||
: typer ( align sz "name" ) create , ,
|
||||
: typer ( sz "name" ) create dup , 1 max cell min ,
|
||||
does> dup cell+ @ last-align ! @ ;
|
||||
1 1 typer i8
|
||||
2 2 typer i16
|
||||
4 4 typer i32
|
||||
cell 8 typer i64
|
||||
cell cell typer ptr
|
||||
long-size long-size typer long
|
||||
1 typer i8
|
||||
2 typer i16
|
||||
4 typer i32
|
||||
8 typer i64
|
||||
cell typer ptr
|
||||
long-size typer long
|
||||
|
||||
variable last-struct
|
||||
|
||||
: struct ( "name" ) 1 0 typer latestxt >body last-struct !
|
||||
: struct ( "name" ) 0 typer latestxt >body last-struct !
|
||||
1 last-align ! ;
|
||||
: align-by ( a n -- a ) 1- dup >r + r> invert and ;
|
||||
: max! ( n a -- ) swap over @ max swap ! ;
|
||||
|
||||
Reference in New Issue
Block a user