• Home
  • Raw
  • Download

Lines Matching full:environment

18     from .environment import Environment
211 def compile_rules(environment: "Environment") -> t.List[t.Tuple[str, str]]: argument
212 """Compiles all the rules from the environment into a list of rules."""
216 len(environment.comment_start_string),
218 e(environment.comment_start_string),
221 len(environment.block_start_string),
223 e(environment.block_start_string),
226 len(environment.variable_start_string),
228 e(environment.variable_start_string),
232 if environment.line_statement_prefix is not None:
235 len(environment.line_statement_prefix),
237 r"^[ \t\v]*" + e(environment.line_statement_prefix),
240 if environment.line_comment_prefix is not None:
243 len(environment.line_comment_prefix),
245 r"(?:^|(?<=\S))[^\S\r\n]*" + e(environment.line_comment_prefix),
426 def get_lexer(environment: "Environment") -> "Lexer": argument
429 environment.block_start_string,
430 environment.block_end_string,
431 environment.variable_start_string,
432 environment.variable_end_string,
433 environment.comment_start_string,
434 environment.comment_end_string,
435 environment.line_statement_prefix,
436 environment.line_comment_prefix,
437 environment.trim_blocks,
438 environment.lstrip_blocks,
439 environment.newline_sequence,
440 environment.keep_trailing_newline,
445 _lexer_cache[key] = lexer = Lexer(environment)
470 """Class that implements a lexer for a given environment. Automatically
471 created by the environment class, usually you don't have to do that.
473 Note that the lexer is not automatically bound to an environment.
477 def __init__(self, environment: "Environment") -> None: argument
500 root_tag_rules = compile_rules(environment)
502 block_start_re = e(environment.block_start_string)
503 block_end_re = e(environment.block_end_string)
504 comment_end_re = e(environment.comment_end_string)
505 variable_end_re = e(environment.variable_end_string)
508 block_suffix_re = "\\n?" if environment.trim_blocks else ""
510 self.lstrip_blocks = environment.lstrip_blocks
512 self.newline_sequence = environment.newline_sequence
513 self.keep_trailing_newline = environment.keep_trailing_newline