tags
The community/lang/tags directory contains a collection of files that define tags, actions, and rules for various programming language constructs. These files work together to provide a more natural and efficient way to write code using voice commands.
The directory is organized by concept, with each concept having a corresponding .py file that defines the actions, and a corresponding .talon file that defines the voice commands. For example, operators_math.py defines actions for inserting mathematical operators, and operators_math.talon defines the voice commands for those actions.
Here's a breakdown of the most important files and how they work together:
comment_block.py,comment_block.talon,comment_line.py,comment_line.talon,comment_documentation.py, andcomment_documentation.talon: These files define commands for inserting various types of comments. The.pyfiles define actions for inserting block comments, line comments, and documentation comments, while the.talonfiles provide the voice commands for these actions. Notably,comment_block.pydefines acode_comment_block_c_liketag and associated actions that are specific to C-style block comments.operators_*.pyandoperators_*.talon: These files define commands for inserting operators. There are several pairs of these files, such asoperators_math.pyandoperators_math.talon,operators_assignment.pyandoperators_assignment.talon,operators_pointer.pyandoperators_pointer.talon,operators_array.pyandoperators_array.talon,operators_lambda.pyandoperators_lambda.talon, andoperators_bitwise.pyandoperators_bitwise.talon. Each pair defines actions and voice commands for specific kinds of operators. For example,operators_mathcovers mathematical, comparison, and logical operators;operators_assignmenthandles assignment and combined assignment operators; andoperators_pointerdefines pointer-related operators. The.talonfiles often use thetag(): user.code_operators_mathsyntax to enable related tags.data_bool.pyanddata_bool.talon: These files define commands for inserting boolean values (trueandfalse). The.pyfile defines the actions, and the.talonfile defines the voice commands.data_null.pyanddata_null.talon: These files define commands for inserting null values and checking for null. The.pyfile defines the actions, and the.talonfile defines the voice commands.object_oriented.pyandobject_oriented.talon: These files provide commands related to object-oriented programming. The.pyfile defines actions for object access, self-references, and class definitions. The.talonfile provides the voice commands and uses theuser.code_object_orientedtag to enable these commands.functions.py,functions.talon,functions_common.py, andfunctions_common.talon: These files define commands for working with functions.functions.pydefines actions for inserting function declarations with various modifiers and type annotations.functions.talondefines voice commands for these actions.functions_common.pyandfunctions_common.talondefine a mechanism for selecting and inserting common functions using a GUI, along with corresponding voice commands.functions_common_gui_active.talonprovides a tag to signify that the function picker GUI is currently displayed.imperative.pyandimperative.talon: These files provide commands for common imperative programming constructs like if, else, for, and while statements.imperative.pydefines the actions, andimperative.talondefines the voice commands.imperative.pyalso defines thecode_block_c_liketag, which indicates that the language uses C-style code blocks (braces).libraries.pyandlibraries.talon: These files define commands for importing libraries.libraries.pydefines actions for importing libraries, whilelibraries.talondefines the voice command for this action and enables theuser.code_librariestag.keywords.pyandkeywords.talon: These files define commands for inserting keywords.keywords.pydefines an action that inserts keywords.keywords.talondefines the voice command for inserting one or more keywords.
These files demonstrate how Talon's tagging and action system is used to create a rich, extensible, and easily customized programming environment using voice commands. The separation of actions and voice commands allows for flexible customization and language-specific implementations.