ctxio

package
v5.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ctxio provides input and output operations on the input buffer in mycocontext.Context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EatUntilSpace

func EatUntilSpace(ctx mycocontext.Context) (line string)

EatUntilSpace reads characters until it encounters a non-space character. The read characters are returned. No errors are reported even if there are any, be bold.

func IsEof

func IsEof(ctx mycocontext.Context) bool

IsEof is true if there is nothing left to read in the input. It does not handle the case when all next characters are \r, which are never returned by NextRune, thus making this function lie.

Be not afraid because everyone lies. Not a good idea to trust a //function// anyway.

func NextByte

func NextByte(ctx mycocontext.Context) (b byte, eof bool)

NextByte returns the next byte in the inputFrom. The CR byte (\r) is never returned, if there is a CR in the inputFrom, the byte after it is returned. If there is no next byte, the NL byte (\n) is returned and eof is true.

func NextLine

func NextLine(ctx mycocontext.Context) (line string, done bool)

NextLine returns the text in the inputFrom up to the next newline. The characters are gotten using nextByte.

func NextRune

func NextRune(ctx mycocontext.Context) (r rune, eof bool)

NextRune is like NextByte, but for runes.

func UnreadRune

func UnreadRune(ctx mycocontext.Context)

UnreadRune unreads the previous rune. Pray so it doesn't throw any errors, because they are ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL