Changeset 50b5464 in sasmodels for sasmodels/codegen.py


Ignore:
Timestamp:
Dec 4, 2017 10:12:20 AM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Children:
7a40b08
Parents:
bf88ef1
Message:

rearrange autoc to allow py2c translation to do whole program analysis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/codegen.py

    rdb03406 r50b5464  
    4949UNARYOP_SYMBOLS[ast.USub] = '-' 
    5050 
     51 
     52def translate(functions, constants): 
     53    # type: (List[Tuple[str, str, int]], Dict[str, Any]) -> str 
     54    snippets = [] 
     55    for source, filename, offset in functions: 
     56        tree = ast.parse(source) 
     57        snippet = to_source(tree) #, filename, offset) 
     58        snippets.append(snippet) 
     59    return "\n".join(snippets) 
    5160 
    5261def to_source(node, indent_with=' ' * 4, add_line_information=False): 
Note: See TracChangeset for help on using the changeset viewer.