isa_parser.py (4297:c4da727c0ded) | isa_parser.py (4335:56e0cd2d3dad) |
---|---|
1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 852 unchanged lines hidden (view full) --- 861 c = compile(f, label + ' wrapper', 'exec') 862 exec c 863 self.func = defInst 864 865 def defineInst(self, name, args, lineno): 866 context = {} 867 updateExportContext() 868 context.update(exportContext) | 1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 852 unchanged lines hidden (view full) --- 861 c = compile(f, label + ' wrapper', 'exec') 862 exec c 863 self.func = defInst 864 865 def defineInst(self, name, args, lineno): 866 context = {} 867 updateExportContext() 868 context.update(exportContext) |
869 context.update({ 'name': name, 'Name': string.capitalize(name) }) | 869 if len(name): 870 Name = name[0].upper() 871 if len(name) > 1: 872 Name += name[1:] 873 context.update({ 'name': name, 'Name': Name }) |
870 try: 871 vars = self.func(self.user_code, context, *args[0], **args[1]) 872 except Exception, exc: 873 error(lineno, 'error defining "%s": %s.' % (name, exc)) 874 for k in vars.keys(): 875 if k not in ('header_output', 'decoder_output', 876 'exec_output', 'decode_block'): 877 del vars[k] --- 1042 unchanged lines hidden --- | 874 try: 875 vars = self.func(self.user_code, context, *args[0], **args[1]) 876 except Exception, exc: 877 error(lineno, 'error defining "%s": %s.' % (name, exc)) 878 for k in vars.keys(): 879 if k not in ('header_output', 'decoder_output', 880 'exec_output', 'decode_block'): 881 del vars[k] --- 1042 unchanged lines hidden --- |