Index: compilers/json/JSON.pir =================================================================== --- compilers/json/JSON.pir (revision 37749) +++ compilers/json/JSON.pir (working copy) @@ -1,82 +0,0 @@ -# Copyright (C) 2005-2008, Parrot Foundation. - -=head1 NAME - -JSON (JavaScript Object Notation) is a lightweight data-interchange format. - -=head1 SYNOPSIS - -Given a valid JSON string, the compiler will return a PMC containing the -appropriate values. For example: - - .local pmc JSON - JSON = compreg 'JSON' - $P0 = JSON('[1,2,3]') - -Will create a pmc that C array, contains the values 1, 2, and 3, and -store it in register C<$P0>. - -For more information about the structure of the JSON representation, see the -documentation at L. - -=cut - -.namespace [ 'JSON' ] - -.sub '__onload' :load - load_bytecode 'PGE.pbc' - load_bytecode 'PGE/Util.pbc' - load_bytecode 'TGE.pbc' - - load_bytecode 'compilers/json/JSON/grammar.pbc' - load_bytecode 'compilers/json/JSON/pge2pir.pbc' - - $P1 = get_global '__compiler' - compreg "JSON", $P1 - - $P1 = new 'Hash' - $P1['\"'] = '"' - $P1['\\'] = "\\" - $P1['\/'] = '/' - $P1['\b'] = "\b" - $P1['\f'] = "\f" - $P1['\n'] = "\n" - $P1['\r'] = "\r" - $P1['\t'] = "\t" - - set_root_global [ 'JSON' ], '$escapes', $P1 -.end - -.sub '__compiler' - .param string json_string - - .local pmc parse, match - parse = get_root_global ['parrot'; 'JSON'], 'value' - - $P0 = get_root_global ['parrot'; 'PGE'], 'Match' - match = $P0.'new'(json_string) - match.'to'(0) - match = parse(match) - unless match goto failed - - .local pmc pirgrammar, pirbuilder, pir - pirgrammar = new ['JSON'; 'PIR'] - pirbuilder = pirgrammar.'apply'(match) - pir = pirbuilder.'get'('result') - - .local pmc pirc, result - pirc = compreg "PIR" - result = pirc(pir) - .tailcall result() - - failed: - $P0 = new 'Exception' - $P0[0] = "invalid JSON value" - throw $P0 -.end - -# Local Variables: -# mode: pir -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4 ft=pir: Property changes on: compilers\json\JSONReader.pir ___________________________________________________________________ Added: svn:mergeinfo Merged /branches/RELEASE_0_8_2/compilers/json/JSON.pir:r34004-34020 Merged /branches/removing_stm/compilers/json/JSON.pir:r35464-35502 Merged /branches/assert_args/compilers/json/JSON.pir:r34776-34857 Merged /branches/jit_h_files/compilers/json/JSON.pir:r34166-35215 Index: compilers/json/postalcodes.pir =================================================================== --- compilers/json/postalcodes.pir (revision 37749) +++ compilers/json/postalcodes.pir (working copy) @@ -68,7 +68,7 @@ $I0 = index json_result, "\r\n\r\n" substr json_result, 0, $I0, "" - load_bytecode 'compilers/json/JSON.pbc' + load_bytecode 'library/JSONReader.pbc' $P1 = compreg 'JSON' $P2 = $P1(json_result) Index: compilers/json/test.pir =================================================================== --- compilers/json/test.pir (revision 37749) +++ compilers/json/test.pir (working copy) @@ -9,7 +9,7 @@ load_bytecode 'PGE.pbc' load_bytecode 'PGE/Util.pbc' - load_bytecode 'compilers/json/JSON.pbc' + load_bytecode 'library/JSONReader.pbc' .local pmc JSON JSON = compreg "JSON" Index: config/gen/makefiles/json.in =================================================================== --- config/gen/makefiles/json.in (revision 37749) +++ config/gen/makefiles/json.in (working copy) @@ -9,15 +9,17 @@ PGE_DIR := ../../compilers/pge TGE_DIR := ../../compilers/tge +PARROT_LIBRARY := ../../runtime/parrot/library + # the default target -all: JSON.pbc +all: $(PARROT_LIBRARY)/JSONReader.pbc # This is a listing of all targets, that are meant to be called by users help: @echo "" @echo "Following targets are available for the user:" @echo "" - @echo " all: JSON.pbc" + @echo " all: JSONReader.pbc" @echo " This is the default." @echo "Testing:" @echo " test: Run the test suite." @@ -36,8 +38,8 @@ testclean: $(RM_F) "../../t/compilers/json/*.pir" -JSON.pbc : JSON/grammar.pbc JSON/pge2pir.pbc JSON.pir - $(PARROT) --output=JSON.pbc JSON.pir +$(PARROT_LIBRARY)/JSONReader.pbc : JSON/grammar.pbc JSON/pge2pir.pbc JSONReader.pir + $(PARROT) --output=$(PARROT_LIBRARY)/JSONReader.pbc JSONReader.pir JSON/grammar.pbc : JSON/grammar.pir $(PARROT) --output=JSON/grammar.pbc JSON/grammar.pir @@ -52,7 +54,7 @@ $(PARROT) $(TGE_DIR)/tgc.pir --output=JSON/pge2pir.pir JSON/pge2pir.tg clean : testclean - $(RM_F) "JSON/*.pbc" "JSON/*.pir" JSON.pbc + $(RM_F) "JSON/*.pbc" "JSON/*.pir" $(PARROT_LIBRARY)/JSONReader.pbc # Local variables: # mode: makefile Index: config/gen/makefiles/root.in =================================================================== --- config/gen/makefiles/root.in (revision 37749) +++ config/gen/makefiles/root.in (working copy) @@ -249,7 +249,7 @@ $(LIBRARY_DIR)/dumper.pbc \ $(LIBRARY_DIR)/yaml_dumper.pbc \ $(LIBRARY_DIR)/Getopt/Obj.pbc \ - $(LIBRARY_DIR)/JSON.pbc \ + $(LIBRARY_DIR)/JSONWriter.pbc \ $(LIBRARY_DIR)/Math/Random/mt19937ar.pbc \ $(LIBRARY_DIR)/Math/Rand.pbc \ $(LIBRARY_DIR)/MIME/Base64.pbc \ Index: MANIFEST =================================================================== --- MANIFEST (revision 37749) +++ MANIFEST (working copy) @@ -55,7 +55,7 @@ compilers/imcc/symreg.c [imcc] compilers/imcc/symreg.h [imcc] compilers/imcc/unit.h [imcc] -compilers/json/JSON.pir [json] +compilers/json/JSONReader.pir [json] compilers/json/JSON/grammar.pg [json] compilers/json/JSON/pge2pir.tg [json] compilers/json/postalcodes.pir [json] @@ -1152,7 +1152,7 @@ runtime/parrot/library/Getopt/Obj.pir [library] runtime/parrot/library/HTTP/Daemon.pir [library] runtime/parrot/library/Iter.pir [library] -runtime/parrot/library/JSON.pir [library] +runtime/parrot/library/JSONWriter.pir [library] runtime/parrot/library/MIME/Base64.pir [library] runtime/parrot/library/Math/Rand.pir [library] runtime/parrot/library/Math/Random/mt19937ar.pir [library] Index: MANIFEST.generated =================================================================== --- MANIFEST.generated (revision 37749) +++ MANIFEST.generated (working copy) @@ -5,10 +5,9 @@ blib/lib/libparrot.1.0.0.dylib [main]lib blib/lib/libparrot.a [main]lib blib/lib/libparrot.dylib [main]lib +blib/lib/libparrot.so [main]lib blib/lib/libparrot.so.1.0.0 [main]lib -blib/lib/libparrot.so [main]lib compilers/json/JSON/grammar.pbc [json] -compilers/json/JSON.pbc [json] compilers/json/JSON/pge2pir.pbc [json] compilers/nqp/nqp.pbc [nqp] config/gen/call_list/opengl.in [] @@ -36,9 +35,9 @@ include/parrot/extend_vtable.h [main]include include/parrot/feature.h [main]include include/parrot/has_header.h [main]include +include/parrot/oplib/core_ops.h [main]include include/parrot/oplib/core_ops_cg.h [main]include include/parrot/oplib/core_ops_cgp.h [main]include -include/parrot/oplib/core_ops.h [main]include include/parrot/oplib/core_ops_switch.h [main]include include/parrot/oplib/ops.h [main]include include/parrot/pbcversion.h [devel]include @@ -47,42 +46,43 @@ include/parrot/platform_limits.h [devel]include include/parrot/vtable.h [main]include install_config.fpmc [main]lib +installable_parrot [main]bin +installable_parrot.exe [main]bin +installable_parrot_config [main]bin installable_parrot_config.exe [main]bin -installable_parrot_config [main]bin +installable_parrot_debugger [main]bin installable_parrot_debugger.exe [main]bin -installable_parrot_debugger [main]bin -installable_parrot.exe [main]bin -installable_parrot [main]bin +installable_pbc_disassemble [main]bin installable_pbc_disassemble.exe [main]bin -installable_pbc_disassemble [main]bin +installable_pbc_dump [main]bin installable_pbc_dump.exe [main]bin -installable_pbc_dump [main]bin +installable_pbc_info [main]bin installable_pbc_info.exe [main]bin -installable_pbc_info [main]bin +installable_pbc_merge [main]bin installable_pbc_merge.exe [main]bin -installable_pbc_merge [main]bin +installable_pbc_to_exe [main]bin installable_pbc_to_exe.exe [main]bin -installable_pbc_to_exe [main]bin lib/Parrot/Config/Generated.pm [devel]lib -libparrot.dll [main]bin lib/Parrot/OpLib/core.pm [devel]lib +lib/Parrot/PMC.pm [devel]lib lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm [devel]lib -lib/Parrot/PMC.pm [devel]lib +libparrot.dll [main]bin +library/JSONReader.pbc [json] parrot.pc [main]pkgconfig +parrot_debugger [main]bin +parrot_debugger.exe [main]bin +pbc_disassemble [main]bin pbc_disassemble.exe [main]bin -pbc_disassemble [main]bin +pbc_dump [main]bin pbc_dump.exe [main]bin -pbc_dump [main]bin +pbc_info [main]bin pbc_info.exe [main]bin -pbc_info [main]bin +pbc_merge [main]bin pbc_merge.exe [main]bin -pbc_merge [main]bin +pbc_to_exe [main]bin pbc_to_exe.exe [main]bin -pbc_to_exe [main]bin -parrot_debugger.exe [main]bin -parrot_debugger [main]bin +pirc [main]bin pirc.exe [main]bin -pirc [main]bin runtime/parrot/dynext/digest_group.bundle [library] runtime/parrot/dynext/digest_group.dll [library] runtime/parrot/dynext/digest_group.dylib [library] @@ -145,38 +145,32 @@ runtime/parrot/include/vtable_methods.pasm [main] runtime/parrot/include/warnings.pasm [main] runtime/parrot/library/CGI/QueryHash.pbc [main] -runtime/parrot/library/config.pbc [main] -runtime/parrot/library/config.pir [main] +runtime/parrot/library/Data/Dumper.pbc [main] runtime/parrot/library/Data/Dumper/Base.pbc [main] runtime/parrot/library/Data/Dumper/Default.pbc [main] -runtime/parrot/library/Data/Dumper.pbc [main] -runtime/parrot/library/dumper.pbc [main] runtime/parrot/library/Getopt/Obj.pbc [main] +runtime/parrot/library/MIME/Base64.pbc [main] +runtime/parrot/library/Math/Rand.pbc [main] runtime/parrot/library/Math/Random/mt19937ar.pbc [main] -runtime/parrot/library/Math/Rand.pbc [main] -runtime/parrot/library/MIME/Base64.pbc [main] runtime/parrot/library/NCI/call_toolkit_init.pbc [main] -runtime/parrot/library/ncurses.pbc [main] +runtime/parrot/library/OpenGL.pbc [main] runtime/parrot/library/OpenGL_funcs.pir [main] -runtime/parrot/library/OpenGL.pbc [main] runtime/parrot/library/P6object.pbc [main] -runtime/parrot/library/Parrot/Capture_PIR.pbc [main] -runtime/parrot/library/Parrot/Coroutine.pbc [main] -runtime/parrot/library/Parrot/Exception.pbc [main] -runtime/parrot/library/Parrot/HLLCompiler.pbc [main] -runtime/parrot/library/parrotlib.pbc [main] -runtime/parrot/library/pcre.pbc [main] +runtime/parrot/library/PCT.pbc [pct] runtime/parrot/library/PCT/Grammar.pbc [pct] runtime/parrot/library/PCT/HLLCompiler.pbc [pct] runtime/parrot/library/PCT/PAST.pbc [pct] -runtime/parrot/library/PCT.pbc [pct] +runtime/parrot/library/PGE.pbc [main] runtime/parrot/library/PGE/Dumper.pbc [main] runtime/parrot/library/PGE/Glob.pbc [main] runtime/parrot/library/PGE/Hs.pbc [main] -runtime/parrot/library/PGE.pbc [main] runtime/parrot/library/PGE/Perl6Grammar.pbc [main] runtime/parrot/library/PGE/Text.pbc [main] runtime/parrot/library/PGE/Util.pbc [main] +runtime/parrot/library/Parrot/Capture_PIR.pbc [main] +runtime/parrot/library/Parrot/Coroutine.pbc [main] +runtime/parrot/library/Parrot/Exception.pbc [main] +runtime/parrot/library/Parrot/HLLCompiler.pbc [main] runtime/parrot/library/Protoobject.pbc [main] runtime/parrot/library/Stream/Base.pbc [main] runtime/parrot/library/Stream/Combiner.pbc [main] @@ -188,6 +182,12 @@ runtime/parrot/library/Stream/Sub.pbc [main] runtime/parrot/library/Stream/Writer.pbc [main] runtime/parrot/library/TGE.pbc [tge] +runtime/parrot/library/config.pbc [main] +runtime/parrot/library/config.pir [main] +runtime/parrot/library/dumper.pbc [main] +runtime/parrot/library/ncurses.pbc [main] +runtime/parrot/library/parrotlib.pbc [main] +runtime/parrot/library/pcre.pbc [main] src/call_list.txt [devel]src src/glut_callbacks.c [] src/jit_emit.h [] Index: ports/cygwin/README =================================================================== --- ports/cygwin/README (revision 37749) +++ ports/cygwin/README (working copy) @@ -147,7 +147,7 @@ /usr/lib/parrot/1.0.0/library/Getopt/Obj.pir /usr/lib/parrot/1.0.0/library/HTTP/Daemon.pir /usr/lib/parrot/1.0.0/library/Iter.pir - /usr/lib/parrot/1.0.0/library/JSON.pir + /usr/lib/parrot/1.0.0/library/JSONWriter.pir /usr/lib/parrot/1.0.0/library/libpcre.pir /usr/lib/parrot/1.0.0/library/Math/Rand.pbc /usr/lib/parrot/1.0.0/library/Math/Rand.pir Index: runtime/parrot/library/Config/JSON.pir =================================================================== --- runtime/parrot/library/Config/JSON.pir (revision 37749) +++ runtime/parrot/library/Config/JSON.pir (working copy) @@ -33,7 +33,7 @@ text = fh.'readall'() # convert the text to an object and return it. - load_bytecode 'compilers/json/JSON.pbc' + load_bytecode 'library/JSONReader.pbc' .local pmc JSON, config JSON = compreg "JSON" @@ -77,7 +77,7 @@ close $P1 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' # Local Variables: # mode: pir Index: runtime/parrot/library/JSON.pir =================================================================== --- runtime/parrot/library/JSON.pir (revision 37749) +++ runtime/parrot/library/JSON.pir (working copy) @@ -1,376 +0,0 @@ -=head1 TITLE - -JSON.pir - PIR implementation of JSON data interchange format. - -=head1 SYNOPSIS - -Use the C<_json> method to generate a JSON representation of a PMC. - - .include 'library/JSON.pir' - $S0 = _json( $P0 ) - -To generate a PMC from a JSON string, see L. - -=cut - -=head1 FUNCTIONS - -This library provides the following functions: - -=over 4 - -=item (string) = _json(pmc, ?pretty ) - -Convert a PMC to a JSON-serialized string. Note: If you pass in a cyclic -structure, JSON will eventually throw a maximum recursion depth exception. - -=over 4 - -=item pmc - -Required. The PMC to dump. - -=item pretty - -Optional. Boolean: If true, then the generated string will be very -readable for humans. Defaults to false, which will generate the -most compact string possible. - -=back - -=cut - -.const string _json_prefix = ' ' - -.sub _json - .param pmc thing - .param int pretty :optional - .param int has_pretty :opt_flag - - .local string result - - if has_pretty goto done_init - pretty = 0 - -done_init: - result = _json_any(thing,pretty,0) - unless pretty goto plain - result .= "\n" -plain: - .return (result) -.end - -.sub _json_any - .param pmc thing - .param int pretty - .param int indent - -done_init: - if_null thing, json_null - - $I0 = does thing, "array" - if $I0 goto json_array - - $I0 = does thing, "hash" - if $I0 goto json_hash - - $I0 = does thing, "string" - if $I0 goto json_string - - $I0 = does thing, "boolean" - if $I0 goto json_boolean - - $I0 = does thing, "integer" - if $I0 goto json_integer - - $I0 = does thing, "float" - if $I0 goto json_float - - # Default to a null. We could in the future make this more - # clever, or conditional. -json_null: - .tailcall _json_null(thing,pretty,indent) -json_string: - .tailcall _json_string(thing,pretty,indent) -json_array: - .tailcall _json_array(thing,pretty,indent) -json_hash: - .tailcall _json_hash(thing,pretty,indent) -json_boolean: - .tailcall _json_boolean(thing,pretty,indent) -json_integer: - .tailcall _json_number(thing,pretty,indent) -json_float: - .tailcall _json_number(thing,pretty,indent) - -.end - -.sub '_json_null' - .param pmc thing # ignored, but needed for the ``API'' - .param int pretty - .param int indent - - unless pretty goto plain - unless indent goto plain - - .local string result - result = repeat _json_prefix, indent - result .= 'null' - .return (result) - -plain: - .return ('null') -.end - -.sub '_json_string' - .param string thing - .param int pretty - .param int indent - - .local string result - - thing = escape thing - - result = '"' . thing - result = result . '"' - - unless pretty goto plain - unless indent goto plain - - $S0 = repeat _json_prefix, indent - result = $S0 . result - -plain: - .return (result) -.end - -.sub '_json_boolean' - .param pmc thing - .param int pretty - .param int indent - - .local string result - - result = 'true' - if thing goto got_value - result = 'false' - -got_value: - - unless pretty goto plain - unless indent goto plain - - $S0 = repeat _json_prefix, indent - result = $S0 . result - -plain: - .return (result) -.end - -.sub '_json_number' - .param pmc thing - .param int pretty - .param int indent - - .local string result - - result = thing - - unless pretty goto plain - unless indent goto plain - - $S0 = repeat _json_prefix, indent - result = $S0 . result - -plain: - .return (result) -.end - -.sub '_json_array' - .param pmc thing - .param int pretty - .param int indent - - .local string result - - result = '[' - .local int len - len = thing - - unless pretty goto pre_loop - unless indent goto pre_loop - - $S0 = repeat _json_prefix, indent - result = $S0 . result - if len goto pre_loop - result .= "\n" - -pre_loop: - inc indent - .local int pos - pos = 0 - unless pretty goto loop - if len == 0 goto done_loop - result .= "\n" - -loop: - if pos >= len goto done_loop - $P1 = thing[pos] - $S0 = _json_any($P1,pretty,indent) - result .= $S0 - inc pos - if pos == len goto loop - result .= "," - unless pretty goto loop - result .= "\n" - goto loop - -done_loop: - dec indent - - .local string optional_newline,optional_indent - optional_newline = '' - optional_indent = '' - - unless pretty goto done - if len == 0 goto indent1 - optional_newline = "\n" - -indent1: - unless indent goto done - optional_indent = repeat _json_prefix, indent - -done: - result .= optional_newline - result .= optional_indent - result .= ']' - - .return (result) - -.end - -.sub '_json_hash' - .param pmc thing - .param int pretty - .param int indent - - .local int not_empty - not_empty = thing - - .local pmc keys - keys = new 'ResizablePMCArray' - .local pmc iter - iter = new 'Iterator', thing - iter = 0 - .local string key - -iter_loop: - unless iter, done_iter - shift key, iter - push keys, key - goto iter_loop - -done_iter: - keys.'sort'() - - .local string result,separator - - result = '{' - separator = ':' - - unless pretty goto pre_loop - separator = ' : ' - unless indent goto pre_loop - - $S0 = repeat _json_prefix, indent - result = $S0 . result - if not_empty goto pre_loop - result .= "\n" - -pre_loop: - inc indent - .local int pos - pos = 0 - unless pretty goto loop - unless not_empty goto done_loop - result .= "\n" - -loop: - if pos >= not_empty goto done_loop - key = keys[pos] - $S0 = _json_string(key,pretty,indent) - result .= $S0 - result .= separator - $P1 = thing[key] - $S0 = _json_any($P1,pretty,indent) - - # remove any leading whitespace on the value's string. - unless pretty goto space_loop_skip - - .local int space_pos,space_len - space_pos = 0 - space_len = length $S0 - -space_loop: - if space_pos >= space_len goto space_loop_done - $I0 = ord $S0, space_pos - if $I0 != 32 goto space_loop_done - - inc space_pos - goto space_loop - -space_loop_done: - $S0 = substr $S0, space_pos - -space_loop_skip: - - result .= $S0 - inc pos - if pos == not_empty goto loop - result .= "," - unless pretty goto loop - result .= "\n" - goto loop - -done_loop: - dec indent - - .local string optional_newline,optional_indent - optional_newline = '' - optional_indent = '' - - unless pretty goto done - unless not_empty goto indent1 - optional_newline = "\n" - -indent1: - unless indent goto done - optional_indent = repeat _json_prefix, indent - -done: - result .= optional_newline - result .= optional_indent - result .= '}' - - .return (result) -.end - -=back - -=head1 TODO - -=over 4 - -=item 1 - -Thunk a better way to deal with the maximum recursion depth exception (Or make it official) - -=back - -=cut - -# Local Variables: -# mode: pir -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4 ft=pir: Index: runtime/parrot/library/JSONWriter.pir =================================================================== --- runtime/parrot/library/JSONWriter.pir (revision 37749) +++ runtime/parrot/library/JSONWriter.pir (working copy) @@ -1,15 +1,15 @@ =head1 TITLE -JSON.pir - PIR implementation of JSON data interchange format. +JSONWriter.pir - PIR implementation of JSON data interchange format. =head1 SYNOPSIS Use the C<_json> method to generate a JSON representation of a PMC. - .include 'library/JSON.pir' + .include 'library/JSONWriter.pir' $S0 = _json( $P0 ) -To generate a PMC from a JSON string, see L. +To generate a PMC from a JSON string, see L. =cut Property changes on: runtime\parrot\library\JSONWriter.pir ___________________________________________________________________ Added: svn:mergeinfo Merged /branches/assert_args/runtime/parrot/library/JSON.pir:r34776-34857 Merged /branches/jit_h_files/runtime/parrot/library/JSON.pir:r34166-35215 Merged /branches/RELEASE_0_8_2/runtime/parrot/library/JSON.pir:r34004-34020 Merged /branches/removing_stm/runtime/parrot/library/JSON.pir:r35464-35502 Index: t/compilers/json/from_parrot.t =================================================================== --- t/compilers/json/from_parrot.t (revision 37749) +++ t/compilers/json/from_parrot.t (working copy) @@ -33,7 +33,7 @@ $S0 = _json( s, 0 ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE "" OUT @@ -48,7 +48,7 @@ $S0 = _json( s, 0 ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE "abcdeABCDE01234$%^&*" OUT @@ -63,7 +63,7 @@ $S0 = _json( s, 0 ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE "abcde\\ABCDE\"01234\n$%^&*" OUT @@ -89,7 +89,7 @@ $S0 = _json( i, 0 ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE 0 35 @@ -116,7 +116,7 @@ $S0 = _json( n ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE 0 2.5 @@ -143,7 +143,7 @@ $S0 = _json( n, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE "abcde\\ABCDE\"01234\n$%^&*" -42 @@ -172,7 +172,7 @@ $S0 = _json( array, 0 ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE [0,1,2,3,4,5,6,7,8,9] OUT @@ -199,7 +199,7 @@ $S0 = _json( array, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE [ 0, @@ -233,7 +233,7 @@ $S0 = _json( array, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE [ 35, @@ -263,7 +263,7 @@ $S0 = _json( array, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE [ 0, @@ -290,7 +290,7 @@ $S0 = _json( hash, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE { "alpha" : 29, @@ -315,7 +315,7 @@ $S0 = _json( hash, 0 ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE {"alpha":29,"beta":"B","delta":"DELTA","gamma":3.1} OUT @@ -352,7 +352,7 @@ $S0 = _json( world, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE { "population" : 1234567890, @@ -403,7 +403,7 @@ $S0 = _json( world, 0 ) say $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE {"population":1234567890,"some_country":[[{"Perl":"Highway","Python":"Grove","Ruby":"Lane"},{}],[]]} OUT @@ -428,7 +428,7 @@ $S0 = _json( s, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE "" "" @@ -456,7 +456,7 @@ $S0 = _json( i, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE 0 0 @@ -484,7 +484,7 @@ $S0 = _json( b, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE false false @@ -510,7 +510,7 @@ $S0 = _json( n, 1 ) print $S0 .end -.include 'library/JSON.pir' +.include 'library/JSONWriter.pir' CODE null null Index: t/compilers/json/to_parrot.t =================================================================== --- t/compilers/json/to_parrot.t (revision 37749) +++ t/compilers/json/to_parrot.t (working copy) @@ -689,7 +689,7 @@ return pir_output_is( <<"END_PIR", $dumped, $reason, %args ); .sub test :main - load_bytecode 'compilers/json/JSON.pbc' + load_bytecode 'library/JSONReader.pbc' load_bytecode 'library/dumper.pbc' .local pmc JSON, result @@ -710,7 +710,7 @@ return pir_error_output_like( <<"END_PIR", qr/not a valid JSON value/, $reason, %args ); .sub test :main - load_bytecode 'compilers/json/JSON.pbc' + load_bytecode 'library/JSONReader.pbc' .local pmc JSON, result JSON = compreg "JSON" Index: t/library/mime_base64.t =================================================================== --- t/library/mime_base64.t (revision 37749) +++ t/library/mime_base64.t (working copy) @@ -24,7 +24,7 @@ load_bytecode 'MIME/Base64.pir' load_bytecode 'PGE.pbc' load_bytecode 'PGE/Util.pbc' - load_bytecode 'compilers/json/JSON.pbc' + load_bytecode 'library/JSONReader.pbc' .local pmc plan, is, ok plan = get_hll_global [ 'Test'; 'More' ], 'plan'