Changeset 982


Ignore:
Timestamp:
Jun 27, 2012 2:33:01 PM (11 years ago)
Author:
jemian
Message:

also match cdef() embedded within an if(){} block, as in standard.mac

Location:
specdomain/trunk/src/specdomain
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • specdomain/trunk/src/specdomain/macros/cdef-examples.mac

    r966 r982  
    4545cdef("user_waitmove","\nwait(1);\n","waitmove_hack","0x20")
    4646
     47# it's possible to embed cdef in a block like this, like in standard.mac
     48if DECISION==1{cdef("user_offsim", "getE;", "embedded")}
     49
    4750""" end of  $Id$ """
  • specdomain/trunk/src/specdomain/sphinxcontrib/specmacrofileparser.py

    r981 r982  
    193193        self.findings.append(dict(m))
    194194        return True
     195
    195196    extended_comment_start_sig_re = re.compile(string_start
    196197                                                + non_greedy_whitespace
  • specdomain/trunk/src/specdomain/test/tester4.py

    r979 r982  
    1212import os
    1313
     14# TODO: consider multiline declaration signtures
     15# This test module only considers single line declarations
    1416
    1517spec_macro_declaration_match_re = re.compile(
     
    2325                            + r'$'                      # line end
    2426                        )
     27
    2528spec_cdef_declaration_match_re = re.compile(
    2629                              r'^'                      # line start
    27                             + r'\s*?'                   # optional blank space
     30                            + r'.*?'                    # optional any kind of preceding stuff, was \s*? (optional blank space)
    2831                            + r'(cdef)'                 # 0: cdef
    2932                            + r'\('                     # opening parenthesis
    3033                            + r'(.*?)'                  # 1: args (anything between the parentheses)
    3134                            + r'\)'                     # closing parenthesis
    32                             + r'\s*?'                   # optional blank space
     35                            + r'.*?'                    # optional blank space
    3336                            + r'(#.*?)?'                # 2: optional comment
    3437                            + r'$'                      # line end
     
    5962}
    6063
     64for name, test in tests.items():
     65    print "%10s  %s" % (name, test.pattern)
     66
    6167for f in sorted(os.listdir(TEST_DIR)):
    6268    if f.endswith('.mac'):
Note: See TracChangeset for help on using the changeset viewer.