
from .MultipleRulesGrammar import MultipleRulesGrammar as Grammar


class PrettyApiGrammar(Grammar):
    def __init__(self,
                 terminals=None,
                 nonterminals=None,
                 rules=None,
                 start_symbol=None):
        if isinstance(terminals, str):
            temp = []
            for ch in terminals:
                temp.append(ch)
            terminals = temp
        super().__init__(terminals=terminals,
                         nonterminals=nonterminals,
                         rules=rules,
                         start_symbol=start_symbol)


from .MultipleRulesGrammar import MultipleRulesGrammar as Grammar


class PrettyApiGrammar(Grammar):
    def __init__(self,
                 terminals=None,
                 nonterminals=None,
                 rules=None,
                 start_symbol=None):
        if isinstance(terminals, str):
            temp = []
            for ch in terminals:
                temp.append(ch)
            terminals = temp
        super().__init__(terminals=terminals,
                         nonterminals=nonterminals,
                         rules=rules,
                         start_symbol=start_symbol)
    def __copy__(self):
        return PrettyApiGrammar(terminals=(t.s for t in self.terms()),
                                nonterminals=self.nonterms(),
                                rules=self.rules(),
                                start_symbol=self.start_get())

Add __copy__ method to grammar
Add __copy__ method to grammar

  
  from .MultipleRulesGrammar import MultipleRulesGrammar as Grammar
  
  
  class PrettyApiGrammar(Grammar):
      def __init__(self,
                   terminals=None,
                   nonterminals=None,
                   rules=None,
                   start_symbol=None):
          if isinstance(terminals, str):
              temp = []
              for ch in terminals:
                  temp.append(ch)
              terminals = temp
          super().__init__(terminals=terminals,
                           nonterminals=nonterminals,
                           rules=rules,
                           start_symbol=start_symbol)
+     def __copy__(self):
+         return PrettyApiGrammar(terminals=(t.s for t in self.terms()),
+                                 nonterminals=self.nonterms(),
+                                 rules=self.rules(),
+                                 start_symbol=self.start_get())
  
Add __copy__ method to grammar
## Code Before:

from .MultipleRulesGrammar import MultipleRulesGrammar as Grammar


class PrettyApiGrammar(Grammar):
    def __init__(self,
                 terminals=None,
                 nonterminals=None,
                 rules=None,
                 start_symbol=None):
        if isinstance(terminals, str):
            temp = []
            for ch in terminals:
                temp.append(ch)
            terminals = temp
        super().__init__(terminals=terminals,
                         nonterminals=nonterminals,
                         rules=rules,
                         start_symbol=start_symbol)

## Instruction:
Add __copy__ method to grammar
## Code After:

from .MultipleRulesGrammar import MultipleRulesGrammar as Grammar


class PrettyApiGrammar(Grammar):
    def __init__(self,
                 terminals=None,
                 nonterminals=None,
                 rules=None,
                 start_symbol=None):
        if isinstance(terminals, str):
            temp = []
            for ch in terminals:
                temp.append(ch)
            terminals = temp
        super().__init__(terminals=terminals,
                         nonterminals=nonterminals,
                         rules=rules,
                         start_symbol=start_symbol)
    def __copy__(self):
        return PrettyApiGrammar(terminals=(t.s for t in self.terms()),
                                nonterminals=self.nonterms(),
                                rules=self.rules(),
                                start_symbol=self.start_get())
