Changeset 08b2d0dafb742d94ce8944c79e765ed244d26a21


Ignore:
Timestamp:
30.07.2013 00:31:09 (8 years ago)
Author:
Stanislaw Klekot <dozzie@…>
Branches:
b66903eafbcb1d49112014abc82c8bf683413db0
Children:
0dade63e962bef31d19d5223fa5fc7822f04a6fe
Parents:
9334cb112a013fff62043c4faf833ddbf6f7c17b
git-author:
Stanislaw Klekot <dozzie@…> (30.07.2013 00:31:09)
git-committer:
Stanislaw Klekot <dozzie@…> (30.07.2013 00:31:09)
Message:

Added defending against not called yet $macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dashwiki/markup/ast/resolve_macros.py

    r2d9786 r08b2d0  
    205205    if node_name == 'macro_call': 
    206206      node_id = id(tree) 
     207      if node_id not in parents: 
     208        return { 'error': [ 
     209          'no result for macro ', 
     210          { 'tt_text': ['@', children[0], '()'] }, 
     211          ' (?!?)' 
     212        ] } 
    207213      return parents[node_id] 
    208214 
     
    213219    if node_name == 'MACRO_VALUE': 
    214220      macro_name = children[0][1:] 
     221      if macro_name not in parents: 
     222        return { 'error': [ 
     223          'macro ', 
     224          { 'tt_text': ['@', macro_name, '()'] }, 
     225          ' was not called', 
     226        ] } 
    215227      return parents[macro_name] 
    216228 
Note: See TracChangeset for help on using the changeset viewer.