Skip to content

v0.1.0

Latest
Compare
Choose a tag to compare
@Vovan-VE Vovan-VE released this 06 Nov 10:47
a1b86a5
  • Add: A Terminal can now be defined with more trivial callbacks. The *TerminalFactory now has FuncByte() and FuncRune():
    NewTerm(tInt, "int").FuncByte(isDigit, bytesToInt)
    NewWhitespace().FuncRune(unicode.IsSpace)
    
    func isDigit(b byte) bool              { return b >= '0' && b <= '9' }
    func bytesToInt(b []byte) (int, error) { return strconv.Atoi(string(b)) }