Commits

Anonymous committed 92eb4c8

The Paragraph macro doesn't parse its arguments

  • Participants
  • Parent commits 7e66353

Comments (0)

Files changed (8)

File sneakylang/macro.py

 class Macro(object):
     """ All macros should derive from this class """
     name = None # define macro name
-    help = """<this macro haven't specified usage example>"""
-    parsers_allowed = None
+    help = "<this macro doesn't have usage example>"
 
     def __init__(self, register_map, builder, state=None):
         object.__init__(self)
         self.state = state
 
     def get_argument_list(self, argument_string):
-        """ DEPRECATED: Use get_arguments instead. 
+        """ DEPRECATED: Use get_arguments instead.
         Return list of arguments. Uses ARGUMENT_SEPARATOR as argument separator."""
         return parse_macro_arguments(argument_string)
 
             from register import Register
             return Register()
 
-    register = property(fget=_get_register)
+    register = property(fget=_get_register)

File sneakylang/macro_caller.py

         last_char = char
 
     if len(buffer) > 0:
-        # FIXME: This is cut& pasted from char == ARGUMENT_SEPARATOR
+        # FIXME: This is cut & pasted from char == ARGUMENT_SEPARATOR
         if len(buffer) > 0:
             if current_kwarg_name:
                 if kwargs.has_key(current_kwarg_name):

File sneakylang/test/module_test.py

 class ParagraphMacro(Macro):
     name = 'odstavec'
     help = '((odstavec text odstavce))'
-    parsersAllowed = ['Strong']
 
-    @classmethod
-    def get_argument_list(self, argument_string):
-        return [argument_string]
+    def parse_argument_string(self, argument_string):
+        self.arguments = [argument_string]
 
     def expand_to_nodes(self, *args):
         if len(args) < 1:
         if not end:
             logging.debug('End %s of macro %s not found, rolling back' % (self.__class__.end, self))
             raise ParserRollback
-        self.stream = s
         self.argument_string = self.stream[0:end.start()]
         self.stream = self.stream[end.end():]
 

File sneakylang/test/test_macro.py

File contents unchanged.

File sneakylang/test/test_macro_caller.py

File contents unchanged.

File sneakylang/test/test_macro_syntax.py

         self.assertEquals(o.children[0].children[1].__class__, TextNode)
         self.assertEquals(o.children[0].children[1].content, ' text odstavce')
 
-    def testProperNestedQuoted(self):
-        s = '((odstavec "silne silny)) text odstavce"))'
-        o = parse(s, self.register_map, document_root=True)
-        self.assertEquals(len(o.children), 1)
-        self.assertEquals(o.children[0].__class__, ParagraphNode)
-        self.assertEquals(o.children[0].children[0].__class__, TextNode)
-        self.assertEquals(o.children[0].children[0].content, 'silne silny)) text odstavce')
-
 class TestKeywordMacroArguments(TestCase):
     def setUp(self):
         self.register_map = RegisterMap({

File sneakylang/test/test_register.py

File contents unchanged.

File sneakylang/test/test_regressions.py

         tn.content = '<b>not bold</b>'
         p.children.append(tn)
         self.assertEquals(expand(p, 'docbook5', node_map), '<para>&lt;b&gt;not bold&lt;/b&gt;</para>')
-