<s> from pygments . lexer import RegexLexer <EOL> from pygments . lexer import words <EOL> from pygments . token import Keyword , Literal , Name , Operator , Text <EOL> from awsshell . index . completion import CompletionIndex <EOL> class ShellLexer ( RegexLexer ) : <EOL> """<STR_LIT>""" <EOL> completion_index = CompletionIndex ( ) <EOL> completion_index . load_completions ( ) <EOL> tokens = { <EOL> '<STR_LIT:root>' : [ <EOL> ( words ( <EOL> tuple ( completion_index . commands ) , <EOL> prefix = r'<STR_LIT>' , <EOL> suffix = r'<STR_LIT>' ) , <EOL> Literal . String ) , <EOL> ( words ( <EOL> tuple ( completion_index . subcommands ) , <EOL> prefix = r'<STR_LIT>' , <EOL> suffix = r'<STR_LIT>' ) , <EOL> Name . Class ) , <EOL> ( words ( <EOL> tuple ( list ( completion_index . args_opts ) ) , <EOL> prefix = r'<STR_LIT>' , <EOL> suffix = r'<STR_LIT>' ) , <EOL> Keyword . Declaration ) , <EOL> ( words ( <EOL> tuple ( completion_index . global_opts ) , <EOL> prefix = r'<STR_LIT>' , <EOL> suffix = r'<STR_LIT>' ) , <EOL> Operator . Word ) , <EOL> ( r'<STR_LIT>' , Text ) , <EOL> ] <EOL> } </s>
