package clarity-lang

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Integer : sig ... end
type program = definition list
and definition =
  1. | Constant of identifier * expression
  2. | DataVar of identifier * type' * expression
  3. | Map of identifier * identifier * type' * identifier * type'
  4. | PublicFunction of function'
  5. | PublicReadOnlyFunction of function'
  6. | PrivateFunction of function'
and function' = identifier * parameter list * expression list
and parameter = string * type'
and expression =
  1. | Identifier of string
  2. | Literal of literal
  3. | SomeExpression of expression
  4. | ListExpression of expression list
  5. | IsNone of expression
  6. | IsSome of expression
  7. | IsErr of expression
  8. | IsOk of expression
  9. | DefaultTo of expression * expression
  10. | VarGet of identifier
  11. | VarSet of identifier * expression
  12. | Err of expression
  13. | Ok of expression
  14. | Not of expression
  15. | And of expression list
  16. | Or of expression list
  17. | Eq of expression list
  18. | Lt of expression * expression
  19. | Le of expression * expression
  20. | Gt of expression * expression
  21. | Ge of expression * expression
  22. | Add of expression list
  23. | Sub of expression list
  24. | Mul of expression list
  25. | Div of expression list
  26. | Mod of expression * expression
  27. | Pow of expression * expression
  28. | Xor of expression * expression
  29. | Len of expression
  30. | ToInt of expression
  31. | ToUint of expression
  32. | FunctionCall of identifier * expression list
  33. | Try of expression
  34. | Unwrap of expression * expression
  35. | UnwrapPanic of expression
  36. | UnwrapErr of expression * expression
  37. | UnwrapErrPanic of expression
  38. | If of expression * expression * expression
and literal =
  1. | NoneLiteral
  2. | BoolLiteral of bool
  3. | IntLiteral of Integer.t
  4. | UintLiteral of Integer.t
  5. | BuffLiteral of string
  6. | StringLiteral of string
  7. | TupleLiteral of string * literal
and identifier = string
and type' =
  1. | Principal
  2. | Bool
  3. | Int
  4. | Uint
  5. | Optional of type'
  6. | Response of type' * type'
  7. | Buff of int
  8. | String of int * string_encoding
  9. | List of int * type'
  10. | Tuple of tuple_field list
and tuple_field = identifier * type'
and string_encoding =
  1. | ASCII
  2. | UTF8
val int_literal : int -> literal
val uint_literal : int -> literal
val equal_expression : expression -> expression -> bool
val equal_literal : literal -> literal -> bool
module Sexp : sig ... end
val is_primitive : string -> bool
type token =
  1. | UINT of Integer.t
  2. | TRUE
  3. | STRING of string
  4. | RPAREN
  5. | RBRACE
  6. | NONE
  7. | LPAREN
  8. | LBRACE
  9. | INT of Integer.t
  10. | ID of string
  11. | FALSE
  12. | EOF
  13. | COLON
  14. | BUFF of string
exception Error
val parse : (Stdlib.Lexing.lexbuf -> token) -> Stdlib.Lexing.lexbuf -> Sexp.t list
val literal : (Stdlib.Lexing.lexbuf -> token) -> Stdlib.Lexing.lexbuf -> literal
val expression : (Stdlib.Lexing.lexbuf -> token) -> Stdlib.Lexing.lexbuf -> Sexp.t
val read_token : Stdlib.Lexing.lexbuf -> token
val parse_program : string -> program
val parse_definition : Sexp.t -> definition
val parse_expression : Sexp.t -> expression
val parse_type : Sexp.t -> type'
val print_program : Stdlib.Format.formatter -> program -> unit
val print_definition : Stdlib.Format.formatter -> definition -> unit
val print_parameter : Stdlib.Format.formatter -> parameter -> unit
val print_expression : Stdlib.Format.formatter -> expression -> unit
val print_literal : Stdlib.Format.formatter -> literal -> unit