<s> from . state import EOF <EOL> from . tokens import TokenEof <EOL> from . tokens_base import TOKEN_COMMAND_PRINT <EOL> from . tokens_base import TokenOfCommand <EOL> from Vintageous import ex <EOL> @ ex . command ( '<STR_LIT>' , '<STR_LIT:p>' ) <EOL> class TokenCommandPrint ( TokenOfCommand ) : <EOL> def __init__ ( self , params , * args , ** kwargs ) : <EOL> super ( ) . __init__ ( params , <EOL> TOKEN_COMMAND_PRINT , <EOL> '<STR_LIT>' , * args , ** kwargs ) <EOL> self . addressable = True <EOL> self . cooperates_with_global = True <EOL> self . target_command = '<STR_LIT>' <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" . format ( self . content , '<STR_LIT>' . join ( self . flags ) , self . count ) . strip ( ) <EOL> @ property <EOL> def count ( self ) : <EOL> return self . params [ '<STR_LIT:count>' ] <EOL> @ property <EOL> def flags ( self ) : <EOL> return self . params [ '<STR_LIT>' ] <EOL> def scan_command_print ( state ) : <EOL> params = { <EOL> '<STR_LIT:count>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ ] , <EOL> } <EOL> while True : <EOL> c = state . consume ( ) <EOL> state . skip ( '<STR_LIT:U+0020>' ) <EOL> state . ignore ( ) <EOL> if c == EOF : <EOL> return None , [ TokenCommandPrint ( params ) , TokenEof ( ) ] <EOL> if c . isdigit ( ) : <EOL> state . match ( r'<STR_LIT>' ) <EOL> params [ '<STR_LIT:count>' ] = state . emit ( ) <EOL> continue <EOL> m = state . expect_match ( r'<STR_LIT>' ) <EOL> params [ '<STR_LIT>' ] = list ( m . group ( <NUM_LIT:0> ) ) <EOL> state . ignore ( ) <EOL> state . expect ( EOF ) <EOL> break <EOL> return None , [ TokenCommandPrint ( params ) , TokenEof ( ) ] </s>
