token
Type
keyword
Summary
Designates a LiveCode token as part of a chunk expression.
Syntax
token
Description
Use the token keyword to parse a LiveCode statement.
A token is a string of characters delimited by certain punctuation marks. The rules for deciding what a token is are as follows:
- Each of the following characters is a token: + - = * / [ ] (
) { } < > and comma (,).
2. Each of the following characters is a token delimiter: semicolon (;),
space, return, and tab.
3. Each string of any other characters that is either separated by one
of the above characters, or delimited by double quotes, is a token.
The token does not include the separating character(s).
A single token can contain multiple characters, but not multiple words, items, or lines.
note
The token chunk is implemented for the LiveCode language, and probably isn't suitable for use in a general-purpose language parser.
Examples
get token 1 of "someFunction(a+b)" -- yields someFunction
get token 2 of "someFunction(a+b)" -- yields (
get token 3 of "someFunction(a+b)" -- yields a
get token 3 of "a+b" -- yields b
Related
glossary: chunk expression, LiveCode
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile