Crate dotrain

Source
Expand description

.rain to rainlang composer written in rust and made available for NodeJs and broswers through wasm-bindgen in Typescript/Javascript.

  • Dotrain specs can be found here
  • Rainlang specs can be found here

The primary goal of the Rain language is to make smart contract development accessible for as many people as possible. This is fundamentally grounded in our belief that accessibility is the difference between theoretical and practical decentralisation. There are many people who would like to participate in authoring and auditing crypto code but currently cannot. When someone wants/needs to do something but cannot, then they delegate to someone who can, this is by definition centralisation. Fast and easy queue abstraction.

§Features

Includes 3 features:

  • cli A clap based module (CLI app) for functionalities of this library, this features is required for building/installing the binary
  • js-api includes wrappers around main structs and functionalities to provide an API through wasm_bindgen

Re-exports§

pub use rain_metadata;

Modules§

cli
A clap based module to produce a CLI app
error
js_api
Wrappers around main structs and functionalities to provide javascript/typescript API through wasm_bindgen, enabled by js-api feature
types
All data types of RainDocument/RainlangDocument parse tree and RegExp patterns used in parsing process

Structs§

RainDocument
Data structure of a parsed .rain text
RainlangDocument
Data structure (parse tree) of a Rainlang text
Rebind
Store
Meta Storage(CAS)

Functions§

exclusive_parse
Parses a string by extracting the strings outside of matches
fill_in
Fills a poistion in a text with whitespaces by keeping line structure intact
fill_out
Fills a text with whitespaces excluding a position by keeping line structure intact
inclusive_parse
Parses an string by extracting matching strings.
line_number
Calculates the line number of the given position in the given text
parse_cli_key_val
Parse a single key-value pair from cli arg. This is implemented from examples in clap crate docs: https://docs.rs/clap/latest/clap/builder/struct.ValueParser.html#example-1
tracked_trim
Trims a text (removing start/end whitespaces) with reporting the number of deletions