AST.py (9465:4ae4f3f4b870) AST.py (9483:c2d205f278fc)
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 40 unchanged lines hidden (view full) ---

49 def error(self, message, *args):
50 self.location.error(message, *args)
51
52 def embedError(self, message, *args):
53 if args:
54 message = message % args
55 code = self.slicc.codeFormatter()
56 code('''
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 40 unchanged lines hidden (view full) ---

49 def error(self, message, *args):
50 self.location.error(message, *args)
51
52 def embedError(self, message, *args):
53 if args:
54 message = message % args
55 code = self.slicc.codeFormatter()
56 code('''
57panic("Runtime Error at ${{self.location}}, Ruby Time: %d, %s.\\n",
58 curCycle(), $message);
57panic("Runtime Error at ${{self.location}}: %s.\\n", $message);
59''')
60 return code
58''')
59 return code