commentPreParserobject
The “comment” pre-parser. If the command line starts with a special prefix string (by default, “*”, but this can be changed via our commentPrefix property), this pre-parser intercepts the command, treating it as a comment from the player and otherwise ignoring the entire input line. The main purpose is to give players a way to put comments into recorded transcripts, as notes to themselves when later reviewing the transcripts or as notes to the author when submitting play-testing feedback.
commentPreParser
:
StringPreParser
Superclass Tree (in declaration order)
commentPreParser
StringPreParser
PreinitObject
ModuleExecObject
` object`
Summary of Properties
commentPrefix
leadPat
runOrder
warningCount
Inherited from StringPreParser
:
regList
regListSorted
Inherited from ModuleExecObject
:
execAfterMe
execBeforeMe
hasInitialized_
isDoingExec_
isExecuted_
Summary of Methods
Inherited from StringPreParser
:
construct
execute
registerPreParser
runAll
Inherited from ModuleExecObject
:
_execute
classExec
Properties
commentPrefix
The comment prefix. You can change this to any character, or to any sequence of characters (longer sequences, such as ‘//’, will work fine). If a command line starts with this exact string (or starts with whitespace followed by this string), we’ll consider the line to be a comment.
leadPat
The leading-whitespace pattern. We skip any text that matches this pattern at the start of a command line before looking for the comment prefix.
If you don’t want to allow leading whitespace before the comment prefix, you can simply change this to ‘’ - a pattern consisting of an empty string always matches zero characters, so it will prevent us from skipping any leading charactres in the player’s input.
runOrder
OVERRIDDEN
Use a lower execution order than the default, so that we run before most other pre-parsers. Most other pre-parsers are written to handle actual commands, so it’s usually just a waste of time to have them look at comments at all - and can occasionally be problematic, since the free-form text of a comment could confuse a pre-parser that’s expecting a more conventional command format. When the comment pre-parser detects a comment, it halts any further processing of the command - so by running ahead of other pre-parsers, we’ll effectively bypass other pre-parsers when we detect a comment.
warningCount
warning count for entering comments without SCRIPT in effect
Methods
doParsing (str, which)
OVERRIDDEN
no description available
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3