'\" t .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" .TH Byte.parse 3 2025-11-29 "Tomo man-pages" .SH NAME Byte.parse \- convert text to a byte .SH LIBRARY Tomo Standard Library .SH SYNOPSIS .nf .BI Byte.parse\ :\ func(text:\ Text,\ remainder:\ &Text?\ =\ none\ ->\ Byte?) .fi .SH DESCRIPTION Parse a byte literal from text. .SH ARGUMENTS .TS allbox; lb lb lbx lb l l l l. Name Type Description Default text Text The text to parse. - remainder &Text? If non-none, this argument will be set to the remainder of the text after the matching part. If none, parsing will only succeed if the entire text matches. none .TE .SH RETURN The byte parsed from the text, if successful, otherwise `none`. .SH EXAMPLES .EX assert Byte.parse("5") == Byte(5) assert Byte.parse("asdf") == none assert Byte.parse("123xyz") == none remainder : Text assert Byte.parse("123xyz", &remainder) == Byte(123) assert remainder == "xyz" .EE .SH SEE ALSO .BR Tomo-Byte (3)