package ocp-indent
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=f314fa1d6f1ece652a291b552f1f49ec6439c9c3f5e7819e16de5c08d4588fe2
md5=935d03f4f6376d687c46f350ff5eecdd
doc/ocp-indent.lib/IndentBlock/index.html
Module IndentBlock
reverse block updates the stack to account for the original indentation, assumed as correct. Useful for partial indentation
val offset : t -> intReturn the current line offset
val padding : t -> intReturn the padding of the block, ie expected relative indentation of sub-blocks
val indent : t -> intReturn the block indentation
val original_column : t -> intReturn the block original starting column
val empty : tThe empty block
val update : IndentConfig.t -> t -> Nstream.t -> Nstream.token -> tupdate t str tok computes the new block state after processing the token tok in block t. The next tokens can be observed in the stream str.
val dump : t -> unitDisplay token and stack of the block
val guess_indent : int -> t -> intguess_indent line block For indenting empty lines: attempt to guess what the most probable indent at this point would be
val is_clean : t -> boolA block is considered clean when it is not linked to any parser state (ie it's not within a comment, string, or ocamldoc stuff). This is not enough for a safe checkpoint: lots of rules depend on the previous/next token to decide indentation.
val is_at_top : t -> boolTrue only when the block is at the root of the file (the stack is empty, the block isn't included in any syntactical construct). Implies is_clean
val is_declaration : t -> boolReturns true if the given block is at a top-level declaration level, ie not within any expression or type definition, but possibly inside a module, signature or class definition. Implies is_clean. Should be safe for checkpoints
val is_in_comment : t -> boolEither we are at a comment, or within an ocamldoc block