LM Documentation

SRC/index-index.lm Documentation


type U8

U8 is an integer of the range 0 to 255.


(print( '123_u8 ))


type U16

U16 is an integer of the range 0 to 65535.


(print( '123_u16 ))


type U32

U32 is an integer of the range 0 to 4294967295.


(print( '123_u32 ))


type U64

U64 is an integer of the range 0 to 18446744073709551615.


(print( '123_u64 ))


type I8

I8 is an integer of the range -128 to 127.


(print( '123_i8 ))


type I16

I16 is an integer of the range -32768 to 32767.


(print( '123_i16 ))


type I32

I32 is an integer of the range -21474823648 to 21474823647.


(print( '123_i32 ))


type I64

I64 is an integer of the range -9223372036854775808 to 9223372036854775807.


(print( '123_i64 ))


type String

A String is a sequence of bytes terminated by a null character.


(print( 'hello_s ))


mangle-identifier : (k: String) -> S

Mangle a string so that it can become a symbol in an object file.


mangle-identifier : (kt: Type) -> S

Mangle a type so that it can become a symbol in an object file.


mangle-identifier : (k: String)(kt: Type) -> String

Mangle a typed variable so that it can become a symbol in an object file.


escape-string : (s: String) -> String

Escape a string to be sent to GNU assembly output.


escape-literal : (s: String) -> String

Escape a string literal to be sent to GNU assembly output.


escape-string : (s: S) -> S

Escape a string to be sent to GNU assembly output.


exit-error : (msg: String)(t: AST) -> Nil

Exit with a simple message and associated blame.


is-variable : (s: String) -> U64

Test whether a string is a simple variable name.


to-string : (is-used: IsUsed) -> String

Convert a Used type into a String.


infer-expr : (tctx: TContext)(term: AST)(scoped: IsScoped)(hint: Type)(used: IsUsed) -> TContext

Use a Context to infer the type of an expression.