Skip to content

Suggest adding break / continue to Python as statements (like in Java) #1468

Closed
@CodesAway

Description

@CodesAway

community/lang/java/java.py

Lines 224 to 228 in 5a97058

def code_break():
actions.insert("break;")
def code_next():
actions.insert("continue;")

These two methods are not implemented in Python.py (but I'm suggesting they should be).

2024-06-28 17:17:49.608 ERROR cb error topic="phrase" cb=SpeechSystem.engine_event
   17:             talon\lib\_thread.py:19  * # cron thread
   16:                     threading.py:1002* 
   15:                     threading.py:1045* 
   14:                     threading.py:982 * 
   13:                    talon\cron.py:156 | 
   12:                     talon\vad.py:23  | 
   11:                     talon\vad.py:129 | 
   10: talon\scripting\speech_system.py:394 | 
    9:             talon\engines\w2l.py:731 | 
    8:      talon\scripting\dispatch.py:134 | # 'phrase' main:EngineProxy._redispatch()
    7: talon\scripting\speech_system.py:69  | 
    6: -------------------------------------# [stack splice]
    5:      talon\scripting\dispatch.py:134 | # 'phrase' main:SpeechSystem.engine_event()
    4: talon\scripting\speech_system.py:516 | 
    3:      talon\scripting\executor.py:112 | 
    2:  talon\scripting\talon_script.py:823 | 
    1:  talon\scripting\talon_script.py:725 | 
talon.scripting.talon_script.TalonScriptError: 
 in script at c:\users\cross\appdata\roaming\talon\user\community\lang\tags\imperative.talon:17:
 > user.code_next()
NotImplementedError: Action 'user.code_next' exists but the Module method is empty and no Context reimplements it

I noticed they are part of the keywords, allowing keyword continue

ctx.lists["user.code_keyword"] = {
"break": "break",
"continue": "continue",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions