Browse Source

Docs: Tiny fix in docstring in visitors.py

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.12.0
Erez Sh 3 years ago
parent
commit
786adec537
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lark/visitors.py

+ 2
- 2
lark/visitors.py View File

@@ -153,10 +153,10 @@ def merge_transformers(base_transformer=None, **transformers_to_merge):
"""Merge a collection of transformers into the base_transformer, each into its own 'namespace'. """Merge a collection of transformers into the base_transformer, each into its own 'namespace'.


When called, it will collect the methods from each transformer, and assign them to base_transformer, When called, it will collect the methods from each transformer, and assign them to base_transformer,
with their name prefixed with the given keyword, as ``prefix__methodname`.
with their name prefixed with the given keyword, as ``prefix__methodname``.


This function is especially useful for processing grammars that import other grammars, This function is especially useful for processing grammars that import other grammars,
thereby creating some of their rules in a 'namespace'. (i.e with a consitent name prefix)
thereby creating some of their rules in a 'namespace'. (i.e with a consistent name prefix).
In this case, the key for the transformer should match the name of the imported grammar. In this case, the key for the transformer should match the name of the imported grammar.


Parameters: Parameters:


Loading…
Cancel
Save