compiler/extensions.st
changeset 538 16e8536f5cfb
parent 537 fb212e14d1f4
--- a/compiler/extensions.st	Mon Sep 07 08:20:46 2015 +0100
+++ b/compiler/extensions.st	Mon Sep 07 11:53:38 2015 +0100
@@ -399,55 +399,28 @@
 !PPParser methodsFor:'*petitcompiler'!
 
 compile
-    ^ self compile: PPCCompilationOptions default
-
-    "Modified: / 24-08-2015 / 23:39:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPParser methodsFor:'*petitcompiler'!
+    ^ self compileWithOptions: PPCCompilationOptions new
 
-compile:options 
-    | compiler |
-
-    self assert:(options isKindOf:PPCCompilationOptions).
-    compiler := PPCCompiler default.
-    compiler context options:options.
-    ^ compiler compile:self
-
-    "Modified: / 28-08-2015 / 14:25:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-09-2015 / 10:54:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PPParser methodsFor:'*petitcompiler'!
 
-compile: options andParse: input
-    ^ (self compile: options) parse: input
-! !
-
-!PPParser methodsFor:'*petitcompiler'!
+compileWithOptions: options
+    "Compile receiver with given options. Return 
+     an *instance* of the compiler parser which is 
+     ready to use (repeatedly). 
 
-compileAs: name
-    | options |
-    options := PPCCompilationOptions default.
-    options name: name.
-    
-    ^ self compile: options
-
-    "Modified: / 24-08-2015 / 23:39:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPParser methodsFor:'*petitcompiler'!
-
-compileTokenizing
+     `options` may be either an instance of PPCCompilationOptions
+     or an array specifying options like #( tokenizing: true debug: false )
+    " 
     | compiler |
 
-    compiler := PPCCompiler tokenizing.
-    ^ self compileUsingCompiler: compiler
-! !
+    compiler := PPCCompiler new.
+    compiler options: options.
+    ^compiler compile: self
 
-!PPParser methodsFor:'*petitcompiler'!
-
-compileUsingCompiler:aPPCCompiler 
-    ^ aPPCCompiler compile:self
+    "Created: / 07-09-2015 / 10:52:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PPParser methodsFor:'*petitcompiler'!