[svn:parrot] r44991 - trunk/runtime/parrot/library/Config

japhb at svn.parrot.org japhb at svn.parrot.org
Thu Mar 18 03:14:17 UTC 2010


Author: japhb
Date: Thu Mar 18 03:14:16 2010
New Revision: 44991
URL: https://trac.parrot.org/parrot/changeset/44991

Log:
[library] Config::JSON: switch from JSON language (old API, deprecated and removed) to data_json language (new API); change a load_bytecode of a .pir to .pbc

Modified:
   trunk/runtime/parrot/library/Config/JSON.pir

Modified: trunk/runtime/parrot/library/Config/JSON.pir
==============================================================================
--- trunk/runtime/parrot/library/Config/JSON.pir	Thu Mar 18 02:16:45 2010	(r44990)
+++ trunk/runtime/parrot/library/Config/JSON.pir	Thu Mar 18 03:14:16 2010	(r44991)
@@ -36,10 +36,11 @@
     text = fh.'readall'()
 
     # Convert the text to an object and return it.
-    .local pmc json, code, config
-    load_bytecode 'compilers/json/JSON.pbc'
-    json = compreg 'JSON'
-    .tailcall json(text)
+    .local pmc json, code
+    load_language 'data_json'
+    json = compreg 'data_json'
+    code = json.'compile'(text)
+    .tailcall code()
 .end
 
 =head2 WriteConfig(config, filename, ?:compact)
@@ -69,7 +70,7 @@
     expanded = not compact
 
     # render the object as a string.
-    load_bytecode 'JSON.pir'
+    load_bytecode 'JSON.pbc'
     .local string output
     output = _json( config, expanded )
 


More information about the parrot-commits mailing list