code_formatter.py (12563:8d59ed22ae79) | code_formatter.py (13663:9b64aeabf9a5) |
---|---|
1# Copyright (c) 2006-2009 Nathan Binkert <nate@binkert.org> 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 --- 60 unchanged lines hidden (view full) --- 69 if item in __builtin__.__dict__: 70 return __builtin__.__dict__[item] 71 72 try: 73 item = int(item) 74 return self.args[item] 75 except ValueError: 76 pass | 1# Copyright (c) 2006-2009 Nathan Binkert <nate@binkert.org> 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 --- 60 unchanged lines hidden (view full) --- 69 if item in __builtin__.__dict__: 70 return __builtin__.__dict__[item] 71 72 try: 73 item = int(item) 74 return self.args[item] 75 except ValueError: 76 pass |
77 raise IndexError, "Could not find '%s'" % item | 77 raise IndexError("Could not find '%s'" % item) |
78 79class code_formatter_meta(type): 80 pattern = r""" 81 (?: 82 %(delim)s(?P<escaped>%(delim)s) | # escaped delimiter 83 ^(?P<indent>[ ]*)%(delim)s(?P<lone>%(ident)s)$ | # lone identifier 84 %(delim)s(?P<ident>%(ident)s) | # identifier 85 %(delim)s%(lb)s(?P<b_ident>%(ident)s)%(rb)s | # braced identifier --- 232 unchanged lines hidden --- | 78 79class code_formatter_meta(type): 80 pattern = r""" 81 (?: 82 %(delim)s(?P<escaped>%(delim)s) | # escaped delimiter 83 ^(?P<indent>[ ]*)%(delim)s(?P<lone>%(ident)s)$ | # lone identifier 84 %(delim)s(?P<ident>%(ident)s) | # identifier 85 %(delim)s%(lb)s(?P<b_ident>%(ident)s)%(rb)s | # braced identifier --- 232 unchanged lines hidden --- |