# -*- tcl -*- base32::hex.pcx
# Syntax of the commands provided by package base32::hex.
#
# For use by TclDevKit's static syntax checker (v4.1+).
# See http://www.activestate.com/solutions/tcl/
# See http://aspn.activestate.com/ASPN/docs/Tcl_Dev_Kit/4.0/Checker.html#pcx_api
# for the specification of the format of the code in this file.
#

package require pcx
pcx::register base32::hex
pcx::tcldep   0.2 needs tcl 8.5

namespace eval ::base32::hex {}

pcx::message invalidStringLength {String is not a multiple of 8 characters long} err
#pcx::scan <VERSION> <NAME> <RULE>

pcx::check 0.2 std ::base32::hex::decode \
    {checkSimpleArgs 0 -1 {
	base32::hex::checkEString
    }}
pcx::check 0.2 std ::base32::hex::encode \
    {checkSimpleArgs 0 -1 {

    }}

proc base32::hex::checkEString {t i} {
    set w [lindex $t $i]
    if {[getLiteral $w str]} {
	if {[string length $str] % 8 != 0} {
	    logError base32::hex::invalidStringLength [getTokenRange $w]
	}
    }
    return [checkWord $t $i]
}

# Initialization via pcx::init.
# Use a ::base32::hex::init procedure for non-standard initialization.
pcx::complete
