Code Snippets Jolie

Short texts Jolie 🧑‍💻 Code snippets Jolie ✍️ Reading lists Jolie 👀

without comment

package; Lex alias; char_t = uint8_t enum: ParserState { Uninitialized Parsing EOF } enum; TokenType { Invalid = “Invalid/Unrecognized token” Space = “Whitespace (space/tab)” EOL = “End-of-line” Word = “Alphabetic sequence” Number = “Numeric sequence” } proc; show_token_type(t val TokenType) { print(“token {0:d} is {0:s}\n”, t.String()) } interface: Lengthed { fn; .Len(); size_t } interface; […]

with comments :)

package; Lex // Input is expected to be unsigned 8-bit ascii values (0..255), so we’ll alias // uint8 as our character_type. alias; char_t = uint8_t // “enum” does not allow values specified inside the compound, although we could do // this in the ‘enum’ directive (i.e before the ;), e.g. // enum from=-1; Name { […]