mime::addr_specification (private)
mime::addr_specification token
Defined in packages/acs-tcl/tcl/tcllib-doc-procs.tcl
Parse the next address specification using the internal MIME parser state and lookahead. Invalid address syntax can raise an error. This version-dependent helper is not a public API.
- Parameters:
- token (required)
- Internal address-parser token.
- Returns:
- 1 if another address was parsed, or 0 at the end of the list.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: # FRINK: nocheck variable $token upvar 0 $token state set lookahead $state(input) switch -- [parselexeme $token] { LX_ATOM - LX_QSTRING { set state(phrase) $state(buffer) } LX_SEMICOLON { if {[incr state(glevel) -1] < 0} { return -code 7 "extraneous semi-colon" } catch {unset state(comment)} return [addr_specification $token] } LX_COMMA { catch {unset state(comment)} return [addr_specification $token] } LX_END { return 0 } LX_LBRACKET { return [addr_routeaddr $token] } LX_ATSIGN { set state(input) $lookahead return [addr_routeaddr $token 0] } default { return -code 7 [format "unexpected character at beginning (found %s)" $state(buffer)] } } switch -- [parselexeme $token] { LX_ATOM - LX_QSTRING { append state(phrase) " " $state(buffer) return [addr_phrase $token] } LX_LBRACKET { return [addr_routeaddr $token] } LX_COLON { return [addr_group $token] } LX_DOT { set state(local) "$state(phrase)$state(buffer)" unset state(phrase) mime::addr_routeaddr $token 0 mime::addr_end $token } LX_ATSIGN { set state(memberP) $state(glevel) set state(local) $state(phrase) unset state(phrase) mime::addr_domain $token mime::addr_end $token } LX_SEMICOLON - LX_COMMA - LX_END { set state(memberP) $state(glevel) if {($state(lastC) eq "LX_SEMICOLON") && ([incr state(glevel) -1] < 0)} { #TODO: this path is not covered by tests return -code 7 "extraneous semi-colon" } set state(local) $state(phrase) unset state(phrase) } default { return -code 7 [ format "expecting mailbox (found %s)" $state(buffer)] } } return 1XQL Not present: Generic, PostgreSQL, Oracle