token

Typekeyword
DictionaryLCS
LibraryLiveCode Script
Syntax
token
Summary

Designates a LiveCode token as part of a chunk expression.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
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
RelatedKeyword: word, real8
Glossary: chunk expression, LiveCode
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:

  1. 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.

Tagstext processing