@@ -251,14 +251,18 @@ def __init__(self, source_path):
251
251
@wrap_compiler
252
252
class CLikeCompiler (Compiler ):
253
253
""" C / C++ / C-Style compiler, invokes GCC or G++, used this as an
254
- abbreviation for fewer code lines. """
254
+ abbreviation for fewer code lines.
255
+ This can also be used for languages that are compiled to machine code which
256
+ can be executed directly. """
255
257
256
258
def __init__ (self , source_path , language_type ):
257
259
Compiler .__init__ (self , source_path )
258
260
if language_type == 'C' :
259
261
self .__c_args = config .get_config ('gcc_args' )
260
262
elif language_type == 'C++' :
261
263
self .__c_args = config .get_config ('g++_args' )
264
+ elif language_type == 'Pascal' :
265
+ self .__c_args = config .get_config ('fpc_args' )
262
266
else :
263
267
raise AttributeError ('Unknown C/Style language type' )
264
268
return
@@ -350,7 +354,10 @@ def close(self):
350
354
pass
351
355
352
356
@wrap_compiler
353
- class PascalCompiler (Compiler ):
357
+ class PascalCompiler (CLikeCompiler ):
358
+ """ Pascal Compiler, wraps CLikeCompiler. """
359
+ def __init__ (self , source_path ):
360
+ return CLikeCompiler .__init__ (self , source_path , 'Pascal' )
354
361
pass
355
362
356
363
@wrap_compiler
@@ -377,6 +384,7 @@ def __init__(self, source_path, source_type=None):
377
384
r'.py$' : 'Python3' ,
378
385
r'.py3$' : 'Python3' , # Non-standard
379
386
r'.py2$' : 'Python2' , # Non-standard
387
+ r'.pas$' : 'Pascal' ,
380
388
r'.java$' : 'Java' ,
381
389
r'.exe$' : 'Executable' , # Windows executable
382
390
r'^[~.]$' : 'Executable' , # We treat them as executable
0 commit comments