From 757c93709f48912aee16c20421d2d8545cfa4ea4 Mon Sep 17 00:00:00 2001 From: chromatic Date: Thu, 30 Aug 2007 21:25:32 +0000 Subject: [PATCH] [OO] Changed more PMC creation from constant syntax to string style. git-svn-id: https://svn.parrot.org/parrot/trunk@20926 d31e2699-5ff4-0310-a27c-f18f2fbe73fe --- docs/art/pp002-pmc.pod | 14 +-- docs/art/pp003-oop.pod | 6 +- docs/book/ch03_pir_basics.pod | 2 +- docs/book/ch05_pasm.pod | 90 +++++++------- docs/compiler_faq.pod | 18 +-- docs/dev/jit_i386.pod | 2 +- docs/imcc/calling_conventions.pod | 2 +- docs/pdds/draft/pdd16_native_call.pod | 2 +- docs/pdds/draft/pdd17_pmc.pod | 2 +- docs/pdds/pdd03_calling_conventions.pod | 6 +- docs/pdds/pdd21_namespaces.pod | 2 +- docs/pdds/pdd22_io.pod | 2 +- docs/pmc/subs.pod | 2 +- docs/stm/stm_frontend.pod | 10 +- examples/benchmarks/addit.pasm | 4 +- examples/benchmarks/addit.pir | 14 +-- examples/benchmarks/addit2.pir | 14 +-- examples/benchmarks/arriter.pir | 26 ++-- examples/benchmarks/arriter_o1.pir | 26 ++-- examples/benchmarks/bench_newp.pasm | 4 +- examples/benchmarks/freeze.pasm | 2 +- examples/benchmarks/mops.pasm | 10 +- examples/benchmarks/oo1.pasm | 4 +- examples/benchmarks/oo2.pasm | 4 +- examples/benchmarks/oo3.pasm | 8 +- examples/benchmarks/oo4.pasm | 8 +- examples/benchmarks/oo5.pir | 8 +- examples/benchmarks/oo6.pir | 6 +- examples/benchmarks/oofib.pir | 20 +-- examples/benchmarks/primes.pasm | 12 +- examples/benchmarks/primes2.pasm | 18 +-- examples/benchmarks/shared_ref.pasm | 4 +- examples/benchmarks/stress.pasm | 10 +- examples/benchmarks/stress1.pasm | 10 +- examples/benchmarks/stress2.pasm | 6 +- examples/benchmarks/stress3.pasm | 12 +- examples/io/async_select.pir | 2 +- examples/io/httpd.pir | 4 +- examples/japh/japh8.pasm | 4 +- examples/library/ncurses_life.pir | 4 +- examples/namespace/namespace_dump.pir | 2 +- examples/nci/ls.pir | 2 +- examples/pasm/nanoforth.pasm | 2 +- examples/pasm/nanoforth2.pasm | 6 +- examples/past/01-sub.pir | 2 +- examples/pir/hanoi.pir | 8 +- examples/pir/levenshtein.pir | 4 +- examples/pir/queens_r.pir | 4 +- examples/pir/quine_ord.pir | 17 +-- examples/pir/sudoku.pir | 26 ++-- examples/sdl/bounce_parrot_logo.pir | 2 +- examples/sdl/lcd/clock.pir | 16 +-- examples/sdl/mandel.pir | 44 +++---- examples/sdl/minesweeper/field.pir | 156 ++++++++++++------------ examples/sdl/minesweeper/mines.pir | 4 +- examples/sdl/move_parrot_logo.pir | 2 +- examples/sdl/tetris/app.pir | 26 ++-- examples/sdl/tetris/block.pir | 64 +++++----- examples/sdl/tetris/blockdata.pir | 4 +- examples/sdl/tetris/blocks.pir | 30 ++--- examples/sdl/tetris/board.pir | 16 +-- examples/sdl/tetris/boarddata.pir | 6 +- examples/sdl/tetris/eventhandler.pir | 2 +- examples/shootout/ack.pir | 2 +- examples/shootout/binarytrees.pir | 2 +- examples/shootout/fannkuch.pir | 6 +- examples/shootout/fasta.pir | 6 +- examples/shootout/harmonic.pir | 2 +- examples/shootout/knucleotide.pir | 10 +- examples/shootout/nbody.pir | 6 +- examples/shootout/nsieve-bits-2.pir | 4 +- examples/shootout/nsieve-bits.pir | 4 +- examples/shootout/nsieve.pir | 4 +- examples/shootout/partialsums-2.pir | 2 +- examples/shootout/partialsums.pir | 2 +- examples/shootout/pidigits.pir | 24 ++-- examples/shootout/random.pasm | 2 +- examples/shootout/random.pir | 2 +- examples/shootout/recursive-2.pir | 2 +- examples/shootout/recursive.pir | 2 +- examples/shootout/regexdna.pir | 12 +- examples/shootout/revcomp.pir | 2 +- examples/shootout/spectralnorm.pir | 8 +- examples/shootout/takfp.pir | 2 +- examples/tge/branch/branch.g | 2 +- examples/tge/branch/transform.pir | 2 +- src/dynpmc/ext.pir | 2 +- src/dynpmc/main.pasm | 4 +- src/list.c | 4 +- src/ops/pmc.ops | 2 +- src/pmc/timer.pmc | 4 +- t/compilers/imcc/syn/clash.t | 8 +- t/compilers/imcc/syn/keyed.t | 6 +- t/dynpmc/foo.t | 2 +- t/library/dumper.t | 80 ++++++------ t/library/sort.t | 28 ++--- t/pdd15oo/calling.t | 2 +- t/pdd15oo/mmd.t | 14 +-- t/pdd15oo/object-meths.t | 2 +- t/pdd15oo/objects.t | 2 +- t/pmc/addrregistry.t | 2 +- t/pmc/array.t | 58 ++++----- t/pmc/boolean.t | 22 ++-- t/pmc/bound_nci.t | 2 +- t/pmc/closure.t | 2 +- t/pmc/compiler.t | 4 +- t/pmc/coroutine.t | 14 +-- t/pmc/enumerate.t | 6 +- t/pmc/env.t | 28 ++--- t/pmc/exception_handler.t | 2 +- t/pmc/fixedbooleanarray.t | 38 +++--- t/pmc/fixedfloatarray.t | 36 +++--- t/pmc/fixedintegerarray.t | 38 +++--- t/pmc/fixedstringarray.t | 38 +++--- t/pmc/float.t | 152 +++++++++++------------ t/pmc/intlist.t | 20 +-- t/pmc/io.t | 10 +- t/pmc/key.t | 10 +- t/pmc/lexpad.t | 2 +- t/pmc/managedstruct.t | 24 ++-- t/pmc/multiarray.t | 26 ++-- t/pmc/null.t | 2 +- t/pmc/object.t | 2 +- t/pmc/orderedhash.t | 110 ++++++++--------- t/pmc/parrotclass.t | 2 +- t/pmc/parrotlibrary.t | 2 +- t/pmc/parrotrunningthread.t | 2 +- t/pmc/parrotthread.t | 2 +- t/pmc/pmc.t | 38 +++--- t/pmc/pointer.t | 2 +- t/pmc/prop.t | 36 +++--- t/pmc/random.t | 2 +- t/pmc/ref.t | 86 ++++++------- t/pmc/resizablebooleanarray.t | 2 +- t/pmc/resizablefloatarray.t | 42 +++---- t/pmc/resizableintegerarray.t | 34 +++--- t/pmc/retcontinuation.t | 2 +- t/pmc/sarray.t | 146 +++++++++++----------- t/pmc/sharedref.t | 2 +- t/pmc/stmlog.t | 2 +- t/pmc/stmref.t | 2 +- t/pmc/stmvar.t | 2 +- t/pmc/timer.t | 30 ++--- t/pmc/tqueue.t | 6 +- t/pmc/undef.t | 4 +- t/pmc/unmanagedstruct.t | 2 +- t/pmc/version.t | 2 +- t/pmc/vtablecache.t | 2 +- t/stress/gc.t | 2 +- 149 files changed, 1112 insertions(+), 1109 deletions(-) diff --git a/docs/art/pp002-pmc.pod b/docs/art/pp002-pmc.pod index 3080ce2deb..9233dea81a 100644 --- a/docs/art/pp002-pmc.pod +++ b/docs/art/pp002-pmc.pod @@ -203,7 +203,7 @@ something similar? Nope. If you want to access environment variables I need to create a PMC of type C. This is accomplished by -the C opcode like so: C<$P0 = new .Env> After that +the C opcode like so: C<$P0 = new 'Env'> After that statement, C<$P0> will contain a hash consisting of all of the environment variables at that time. All built-in types are prefixed with a dot, so if the PMC type is @@ -231,8 +231,8 @@ environment variables: .local pmc env, iter .local string key, value - env = new .Env # line 3 - iter = new .Iterator, env # line 4 + env = new 'Env' # line 3 + iter = new 'Iterator', env # line 4 iterloop: unless iter goto iterend key = shift iter # line 8 @@ -274,7 +274,7 @@ over the command line this same way? Sure! .sub _ :main .param pmc args .local pmc cmdline - cmdline = new .Iterator, args + cmdline = new 'Iterator', args loop: unless cmdline goto end_loop $S0 = shift cmdline @@ -307,7 +307,7 @@ distribution (parrot/docs) =head3 Example 7: Output random numbers .sub _ :main - $P0 = new .Random + $P0 = new 'Random' $N0 = $P0 print $N0 print "\n" @@ -319,7 +319,7 @@ distribution (parrot/docs) =head3 Example 8: Triggering an exception .sub _ :main - $P0 = new .Exception + $P0 = new 'Exception' $P0['_message'] = "The sky is falling!" throw $P0 .end @@ -333,7 +333,7 @@ distribution (parrot/docs) .end .sub _ :main - $P0 = new .Timer + $P0 = new 'Timer' $P1 = global "expired" $P0[.PARROT_TIMER_HANDLER] = $P1 # call sub in $P1 when timer goes off diff --git a/docs/art/pp003-oop.pod b/docs/art/pp003-oop.pod index eac3b28c4d..dc0c807990 100644 --- a/docs/art/pp003-oop.pod +++ b/docs/art/pp003-oop.pod @@ -226,7 +226,7 @@ same for the rest): .local pmc dog dog = new "Dog" - $P0 = new .String + $P0 = new "String" $P0 = "Phideaux" setattribute dog, "name", $P0 @@ -253,7 +253,7 @@ the value, it does nothing more. Next, I create a new Dog and give it a name. Because attributes may only be PMCs, in order to give the Dog a -name, I first have to create a new .String PMC (this is one +name, I first have to create a new String PMC (this is one of the PMCs builtin to Parrot) and assign the name I wish to give the dog to this PMC. Then I can pass this PMC as a parameter to C to give my Dog a name. @@ -336,7 +336,7 @@ Jonathan Scott Duff .sub setname :method .param string name - $P0 = new .String + $P0 = new 'String' $P0 = name setattribute self, "name", $P0 .end diff --git a/docs/book/ch03_pir_basics.pod b/docs/book/ch03_pir_basics.pod index e6a485cf9a..cb5f143868 100644 --- a/docs/book/ch03_pir_basics.pod +++ b/docs/book/ch03_pir_basics.pod @@ -299,7 +299,7 @@ a higher score and spills the variables with a lower score. In this example it picks C<$I1> and C<$I2>. Behind the scenes, Parrot generates code to store the values: - new P31, .PerlArray + new P31, "PerlArray" ... set I0, 1 # I0 allocated to $I1 set P31[0], I0 # spill $I1 diff --git a/docs/book/ch05_pasm.pod b/docs/book/ch05_pasm.pod index 0be0cebc8d..5dda2331bd 100644 --- a/docs/book/ch05_pasm.pod +++ b/docs/book/ch05_pasm.pod @@ -180,7 +180,7 @@ object; it only calls the PMC's vtable method for assignment. So, rewriting the same example using a PMC has a completely different result: - new P0, .String + new P0, "String" set P0, "Ford" set P1, P0 set P0, "Zaphod" @@ -215,7 +215,7 @@ to look up the integer value of a named type. When the source argument is a PMC and the destination is a string register, C returns the name of the type: - new P0, .String + new P0, "String" typeof S0, P0 # S0 is "String" print S0 print "\n" @@ -226,7 +226,7 @@ In this example, C returns the type name "String". When the source argument is a PMC and the destination is an integer register, C returns the integer representation of the type: - new P0, .String + new P0, "String" typeof I0, P0 # I0 is 36 print I0 print "\n" @@ -327,7 +327,7 @@ Perl's polymorphic scalar behavior. Assigning a string to a number PMC morphs it into a string PMC. Assigning an integer value morphs it to a C, and assigning C morphs it to C: - new P0, .String + new P0, "String" set P0, "Ford\n" print P0 # prints "Ford\n" set P0, 42 @@ -504,9 +504,9 @@ X For PMC registers, C has only a three-argument form with separate registers for source and destination: - new P0, .String - new P1, .String - new P2, .String + new P0, "String" + new P1, "String" + new P2, "String" set P0, "ab" set P1, "cd" concat P2, P0, P1 @@ -652,7 +652,7 @@ string or PMC. Instead of just copying the pointer, as normal assignment would, it recursively copies the string or object underneath. - new P0, .String + new P0, "String" set P0, "Ford" clone P1, P0 set P0, "Zaphod" @@ -953,11 +953,11 @@ specified R. Here's a short illustration of string formats: - new P2, .Array - new P0, .Int + new P2, "Array" + new P0, "Int" set P0, 42 push P2, P0 - new P1, .Num + new P1, "Num" set P1, 10 push P2, P1 sprintf S0, "int %#Px num %+2.3Pf\n", P2 @@ -1013,7 +1013,7 @@ The C opcode joins the elements of an array PMC into a single string. The second argument separates the individual elements of the PMC in the final string result. - new P0, .Array + new P0, "Array" push P0, "hi" push P0, 0 push P0, 1 @@ -1258,7 +1258,7 @@ The CX PMC is an ordered aggregate with zero-baed integer keys. The syntax for X keyed access to a PMC puts the key in square brackets after the register name: - new P0, .Array # obtain a new array object + new P0, "Array" # obtain a new array object set P0, 2 # set its length set P0[0], 10 # set first element to 10 set P0[1], I31 # set second element to I31 @@ -1299,7 +1299,7 @@ X The CX PMC is an unordered aggregate with string keys: - new P1, .Hash # generate a new hash object + new P1, "Hash" # generate a new hash object set P1["key"], 10 # set key and value set I0, P1["key"] # obtain value for key set I1, P1 # number of entries in hash @@ -1309,7 +1309,7 @@ value exists in an aggregate. It returns 1 if it finds the key in the aggregate, and returns 0 if it doesn't. It doesn't care if the value itself is true or false, only that the key has been set: - new P0, .Hash + new P0, "Hash" set P0["key"], 0 exists I0, P0["key"] # does a value exist at "key" print I0 # prints 1 @@ -1327,7 +1327,7 @@ Iterators extract values from an aggregate PMC. You create an iterator by creating a new C PMC, and passing the array to C as an additional parameter: - new P1, .Iterator, P2 + new P1, "Iterator", P2 The include file F defines some constants for working with iterators. The C<.ITERATE_FROM_START> and C<.ITERATE_FROM_END> @@ -1337,11 +1337,11 @@ from the array. An iterator PMC is true as long as it still has values to be retrieved (tested by C below). .include "iterator.pasm" - new P2, .Array + new P2, "Array" push P2, "a" push P2, "b" push P2, "c" - new P1, .Iterator, P2 + new P1, "Iterator", P2 set P1, .ITERATE_FROM_START iter_loop: @@ -1357,11 +1357,11 @@ keys. With hashes it's only meaningful to iterate in one direction, since they don't define any order for their keys. .include "iterator.pasm" - new P2, .Hash + new P2, "Hash" set P2["a"], 10 set P2["b"], 20 set P2["c"], 30 - new P1, .Iterator, P2 + new P1, "Iterator", P2 set P1, .ITERATE_FROM_START_KEYS iter_loop: @@ -1384,8 +1384,8 @@ operation, so PASM provides a way to do it in a single instruction. Complex keys specify a series of nested data structures, with each individual key separated by a semicolon: - new P0, .Hash - new P1, .Array + new P0, "Hash" + new P1, "Array" set P1[2], 42 set P0["answer"], P1 set I1, 2 @@ -1413,8 +1413,8 @@ and that C creates a complete duplicate object. But if you just want to assign the value of one PMC to another PMC, you need the CX opcode: - new P0, .Int - new P1, .Int + new P0, "Int" + new P1, "Int" set P0, 42 set P2, P0 assign P1, P0 # note: P1 has to exist already @@ -1454,9 +1454,9 @@ returns the value of a property. It also takes three arguments: the PMC to store the property's value, the name of the property, and the PMC from which the property value is to be retrieved: - new P0, .String + new P0, "String" set P0, "Zaphod" - new P1, .Int + new P1, "Int" set P1, 1 setprop P0, "constant", P1 # set a property on P0 getprop P3, "constant", P0 # retrieve a property on P0 @@ -1918,7 +1918,7 @@ Global variables are stored in a C, so every variable name must be unique. PASM has two opcodes for globals, C and C: - new P10, .Int + new P10, "Int" set P10, 42 store_global "$foo", P10 # ... @@ -1985,7 +1985,7 @@ C to retrieve a variable from a pad, C to push a pad onto the pad stack, and C to remove a pad from the stack: new_pad 0 # create and push a pad with depth 0 - new P0, .Int # create a variable + new P0, "Int" # create a variable set P0, 10 # assign value to it store_lex 0, "$foo", P0 # store the var at depth 0 by name # ... @@ -2043,10 +2043,10 @@ the stack: new_pad 0 # outer scope new_pad 1 # inner scope - new P0, .Int + new P0, "Int" set P0, 10 store_lex -1, "$foo", P0 # store in top pad - new P1, .Int + new P1, "Int" set P1, 20 store_lex -2, "$foo", P1 # store in next outer scope find_lex P2, "$foo" # find in all scopes @@ -2582,7 +2582,7 @@ snippet: # call _foo newsub P16, .Sub, _foo # new subroutine object at address _foo - new P17, .Int # value for $n + new P17, "Int" # value for $n set P17, 10 # we use local vars from P16 ... set P0, P16 # the subroutine set P5, P17 # first argument @@ -2592,7 +2592,7 @@ snippet: set P18, P5 # the returned closure # call _closure - new P19, .Int # argument to closure + new P19, "Int" # argument to closure set P19, 3 set P0, P18 # the closure set P5, P19 # one argument @@ -2664,7 +2664,7 @@ swapping all stacks). The next time the coroutine is invoked, it continues to execute from the point at which it previously returned: new_pad 0 # push a new lexical pad on stack - new P0, .Int # save one variable in it + new P0, "Int" # save one variable in it set P0, 10 store_lex -1, "var", P0 @@ -2723,7 +2723,7 @@ A continuation is a subroutine that gets a complete copy of the caller's context, including its own copy of the call stack. Invoking a continuation starts or restarts it at the entry point: - new P1, .Int + new P1, "Int" set P1, 5 newsub P0, .Continuation, _con @@ -2975,16 +2975,16 @@ threads (no-one really wants to spawn two threads just to print out a simple string). find_global P5, "_th1" # locate thread function - new P2, .ParrotThread # create a new thread + new P2, "ParrotThread" # create a new thread find_method P0, P2, "thread3" # a shared thread's entry - new P7, .TQueue # create a Queue object - new P8, .Int # and a Int + new P7, "TQueue" # create a Queue object + new P8, "Int" # and a Int push P7, P8 # push the Int onto queue - new P6, .String # create new string + new P6, "String" # create new string set P6, "Js nte artHce\n" set I3, 3 # thread function gets 3 args invoke # _th1.run(P5,P6,P7) - new P2, .ParrotThread # same for a second thread + new P2, "ParrotThread" # same for a second thread find_global P5, "_th2" set P6, "utaohrPro akr" # set string to 2nd thread's invoke # ... data, run 2nd thread too @@ -3010,7 +3010,7 @@ simple string). substr S0, S5, I0, 1 # if not print next char print S0 inc I0 - new P8, .Int # and put a defined entry + new P8, "Int" # and put a defined entry push P7, P8 # onto the queue so that if S0, w2 # the other thread will run invoke P1 # done with string @@ -3077,7 +3077,7 @@ method belongs to the C class. When it's called on a C object, the calling code waits until the thread terminates. - new P2, .ParrotThread # create a new thread + new P2, "ParrotThread" # create a new thread set I5, P2 # get thread ID find_method P0, P2, "join" # get the join method... @@ -3224,7 +3224,7 @@ attribute, creates a C PMC, and stores it as the first attribute: classoffset I0, P2, "Foo" # first "Foo" attribute of object P2 - new P6, .Int # create storage for the attribute + new P6, "Int" # create storage for the attribute setattribute P2, I0, P6 # store the first attribute The C opcodeX takes a PMC @@ -3243,7 +3243,7 @@ There is also support for named parameters with fully qualified parameter names (although this is a little bit slower than getting the class offset once and accessing several attributes by index): - new P6, .Int + new P6, "Int" setattribute P2, "Foo\x0.i", P6 # store the attribute You use the same integer index to retrieve the value of an attribute. @@ -3334,7 +3334,7 @@ the object with an integer: .pcc_sub __init: classoffset I0, P2, "Foo" # lookup first attribute position - new P6, .Int # create storage for the attribute + new P6, "Int" # create storage for the attribute setattribute P2, I0, P6 # store the first attribute invoke P1 # return @@ -3654,7 +3654,7 @@ Z .pcc_sub __init: classoffset I0, P2, "Foo" # lookup first attribute position - new P6, .Int # create a store for the attribute + new P6, "Int" # create a store for the attribute setattribute P2, I0, P6 # store the first attribute invoke P1 # return diff --git a/docs/compiler_faq.pod b/docs/compiler_faq.pod index 80037ceb37..5d03221236 100644 --- a/docs/compiler_faq.pod +++ b/docs/compiler_faq.pod @@ -146,7 +146,7 @@ list in PIR? If you have a variable amounts of arguments in an array, you can pass all items of that array with the C<:flat> directive. - ar = new .ResizablePMCArray + ar = new 'ResizablePMCArray' push ar, "arg 1\n" push ar, "arg 2\n" ... @@ -210,7 +210,7 @@ or the C op: You can retrieve the namespace hash and use the C opcode. .sub main :main - $P0 = new .Integer + $P0 = new 'Integer' store_hll_global 'foo', $P0 store_hll_global ['Bar'], 'baz', $P0 # ... @@ -389,7 +389,7 @@ Or you can specify the constructor method by setting the BUILD property of the class PMC: newclass $P0, 'Dog' # create a class named Dog - new $P1, .String # create a string + new $P1, 'String' # create a string set $P1, 'initialise' # set it to the name of the constructor method setprop $P0, 'BUILD', $P1 # set the BUILD property @@ -412,7 +412,7 @@ You can pass only a single argument to a constructor. By convention, a hash PMC is passed to the constructor that contains the arguments as key/value pairs: - new $P0, .Hash + new $P0, 'Hash' set $P0['greeting'], 'hello' set $P0['size'], 1.23 @@ -434,14 +434,14 @@ TODO Create an Exception object and throw it! - $P0 = new .Exception + $P0 = new 'Exception' throw $P0 Not too hard, is it? =head2 How do I throw an exception with an error message in PIR? - $P0 = new .Exception + $P0 = new 'Exception' $P0['_message'] = 'something happened' throw $P0 @@ -450,7 +450,7 @@ Not too hard, is it? Use C to push an exception handler onto the stack. push_eh handler - $P0 = new .Exception # or any other code ... + $P0 = new 'Exception' # or any other code ... throw $P0 # ... that might throw clear_eh exit 0 @@ -482,7 +482,7 @@ Rethrow the exception if it has a severity of C. =head2 How do I access the error message of an exception I've caught? push_eh handler - $P0 = new .Exception + $P0 = new 'Exception' $P0['_message'] = 'something happened' throw $P0 clear_eh @@ -553,7 +553,7 @@ makefile: Create a new C PMC and access it like a hash. .local pmc e - e = new .Env + e = new 'Env' $P0 = e['USER'] # lt =head2 How can I access Parrot's configuration? diff --git a/docs/dev/jit_i386.pod b/docs/dev/jit_i386.pod index 274bdb54e0..b743cd773a 100644 --- a/docs/dev/jit_i386.pod +++ b/docs/dev/jit_i386.pod @@ -38,7 +38,7 @@ opcode gets executed: end (ret) inc: inc I0 inc_i - new P0, .PerlString new_p_ic + new P0, 'String' new_p_sc set P0, I0 set_p_i print P0 (call) print_p print "\n" print_sc diff --git a/docs/imcc/calling_conventions.pod b/docs/imcc/calling_conventions.pod index ecec1575bb..08519f6189 100644 --- a/docs/imcc/calling_conventions.pod +++ b/docs/imcc/calling_conventions.pod @@ -37,7 +37,7 @@ subroutines. =head2 Explicitly Calling PASM Subroutines .const .Sub $P0 = "_sub_label" - $P1 = new .Continuation + $P1 = new 'Continuation' set_addr $P1, ret_addr ... .local int x diff --git a/docs/pdds/draft/pdd16_native_call.pod b/docs/pdds/draft/pdd16_native_call.pod index bfd39776a7..125aef9626 100644 --- a/docs/pdds/draft/pdd16_native_call.pod +++ b/docs/pdds/draft/pdd16_native_call.pod @@ -257,7 +257,7 @@ it call back into Parrot. .local pmc sub, userdata sub = get_global "foo_callback" # get the sub to act as a callback sub - userdata = new .Integer # set up some userdata + userdata = new 'Integer' # set up some userdata userdata = 42 .local pmc callback_sub diff --git a/docs/pdds/draft/pdd17_pmc.pod b/docs/pdds/draft/pdd17_pmc.pod index 6960638187..09d1f8559f 100644 --- a/docs/pdds/draft/pdd17_pmc.pod +++ b/docs/pdds/draft/pdd17_pmc.pod @@ -1407,7 +1407,7 @@ variable, while writing to it sets the value of a process environment variable. For example, to retrieve the current value of TERM (the terminal type on most Unix systems): - new P1, .Env + new P1, 'Env' set S1, P1['TERM'] Note that an embedding system may override this behavior. diff --git a/docs/pdds/pdd03_calling_conventions.pod b/docs/pdds/pdd03_calling_conventions.pod index 2220e8007c..ff377a526b 100644 --- a/docs/pdds/pdd03_calling_conventions.pod +++ b/docs/pdds/pdd03_calling_conventions.pod @@ -297,17 +297,17 @@ C (pass by reference). =item * When the target is a P register and the source is an integer, the P will be -set to a new .Integer[1] which has been Ced the given integer. +set to a new Integer[1] which has been Ced the given integer. =item * When the target is a P register and the source is a number, the P will be set -to a new .Float[1] which has been Ced the given number. +to a new Float[1] which has been Ced the given number. =item * When the target is a P register and the source is a string, the P will be set -to a new .String[1] which has been Ced the given string. +to a new String[1] which has been Ced the given string. =back diff --git a/docs/pdds/pdd21_namespaces.pod b/docs/pdds/pdd21_namespaces.pod index d5863dc7b6..36d5f6868c 100644 --- a/docs/pdds/pdd21_namespaces.pod +++ b/docs/pdds/pdd21_namespaces.pod @@ -600,7 +600,7 @@ PIR (without error checking): .local pmc tcl .local pmc ns tcl = compreg "tcl" - ns = new .Array + ns = new 'Array' ns = 2 ns[0] = "Some" ns[1] = "Module" diff --git a/docs/pdds/pdd22_io.pod b/docs/pdds/pdd22_io.pod index a70d73d817..371654c1dc 100644 --- a/docs/pdds/pdd22_io.pod +++ b/docs/pdds/pdd22_io.pod @@ -330,7 +330,7 @@ objects, or an Iterator role applied to I/O objects.] =item new - new $P0, .Iterator, $P1 + new $P0, 'Iterator', $P1 Create a new iterator object $P0 from I/O object $P1. diff --git a/docs/pmc/subs.pod b/docs/pmc/subs.pod index 83db804390..ee32cefe71 100644 --- a/docs/pmc/subs.pod +++ b/docs/pmc/subs.pod @@ -41,7 +41,7 @@ F Create a subroutine of class C and assign the subroutine address to it: - new P0, .Sub + new P0, 'Sub' set_addr P0, _sub_label This can be done with one opcode: diff --git a/docs/stm/stm_frontend.pod b/docs/stm/stm_frontend.pod index 28cce96022..294738b12a 100644 --- a/docs/stm/stm_frontend.pod +++ b/docs/stm/stm_frontend.pod @@ -105,11 +105,11 @@ STMVars are safe to pass between threads. =over 4 -=item new .STMVar +=item new 'STMVar' Creates a new variable. Its initial value will be the NULL PMC. -=item new .STMVar, Px +=item new 'STMVar', Px If Px is an STMRef, creates an STMVar instance referring to the same variable as the STMRef. Otherwise, creates a new variable whose initial value Px. @@ -154,12 +154,12 @@ STMRefs are safe to pass between threads. =over 4 -=item new Px, .STMRef +=item new Px, 'STMRef' Creates a new transactionally managed variable which initially contains a clone of Px. -=item new Px, .STMRef, Py +=item new Px, 'STMRef', Py If Py is an STMVar, creates an STMRef referring the same variable as Py. Otherwise, creates a new STM-managed variable which initially contains @@ -193,7 +193,7 @@ supported. =over 4 -=item new Px, .STMLog +=item new Px, 'STMLog' Copies the current transaction into C. If there is no active transaction, C holds an empty transaction. diff --git a/examples/benchmarks/addit.pasm b/examples/benchmarks/addit.pasm index 7370f7d989..9cc786974c 100644 --- a/examples/benchmarks/addit.pasm +++ b/examples/benchmarks/addit.pasm @@ -18,7 +18,7 @@ prints the result (21001097.970000). =cut _main: - new P5, .ResizablePMCArray + new P5, 'ResizablePMCArray' push P5, 1000 push P5, 7.100 push P5, 87 @@ -36,7 +36,7 @@ FIN: end _varargs_adder: - new P2, .Float + new P2, 'Float' set I1, P5 LOOP: dec I1 diff --git a/examples/benchmarks/addit.pir b/examples/benchmarks/addit.pir index b8cb4481da..609453cac8 100644 --- a/examples/benchmarks/addit.pir +++ b/examples/benchmarks/addit.pir @@ -20,22 +20,22 @@ using Parrot calling conventions (PDD 3). It calls an "add it" function .sub addit :main .local pmc a0 - a0 = new .Integer + a0 = new 'Integer' a0 = 1000 .local pmc a1 - a1 = new .Float + a1 = new 'Float' a1 = 7.100 .local pmc a2 - a2 = new .Integer + a2 = new 'Integer' a2 = 87 .local pmc a3 - a3 = new .String + a3 = new 'String' a3 = "3.87" .local pmc a4 - a4 = new .String + a4 = new 'String' a4 = "21000000" .local pmc x - x = new .Integer + x = new 'Integer' x = 500000 AGAIN: dec x @@ -56,7 +56,7 @@ FIN: .param pmc a3 .param pmc a4 .local pmc sum - sum = new .Float + sum = new 'Float' add sum, a0 add sum, a1 add sum, a2 diff --git a/examples/benchmarks/addit2.pir b/examples/benchmarks/addit2.pir index 00a57aa4c6..4121e364a4 100644 --- a/examples/benchmarks/addit2.pir +++ b/examples/benchmarks/addit2.pir @@ -22,22 +22,22 @@ result (21001097.970000). .sub addit2 :main .local pmc a0 - a0 = new .Integer + a0 = new 'Integer' a0 = 1000 .local pmc a1 - a1 = new .Float + a1 = new 'Float' a1 = 7.100 .local pmc a2 - a2 = new .Integer + a2 = new 'Integer' a2 = 87 .local pmc a3 - a3 = new .String + a3 = new 'String' a3 = "3.87" .local pmc a4 - a4 = new .String + a4 = new 'String' a4 = "21000000" .local pmc x - x = new .Integer + x = new 'Integer' x = 500000 .local pmc result AGAIN: @@ -59,7 +59,7 @@ FIN: .param pmc a4 .local pmc sum - sum = new .Float + sum = new 'Float' sum += a0 sum += a1 sum += a2 diff --git a/examples/benchmarks/arriter.pir b/examples/benchmarks/arriter.pir index c6a34fb612..7bc9f16a2f 100644 --- a/examples/benchmarks/arriter.pir +++ b/examples/benchmarks/arriter.pir @@ -25,15 +25,15 @@ F. .include "iterator.pasm" # declaration of lexicals - $P20 = new .Hash + $P20 = new 'Hash' .lex "%ha", $P20 - $P21 = new .Undef + $P21 = new 'Undef' .lex "$i", $P21 - $P22 = new .ResizablePMCArray + $P22 = new 'ResizablePMCArray' .lex "@k", $P22 - $P23 = new .ResizablePMCArray + $P23 = new 'ResizablePMCArray' .lex "@nk", $P23 - $P24 = new .Undef + $P24 = new 'Undef' .lex "$s", $P24 # same as @k = qw( A B C D E F G H I J ); @@ -41,14 +41,14 @@ F. $P29 = 0 for_1_start: unless $P29 < 10 goto for_1_end - $P26 = new .Undef + $P26 = new 'Undef' $P26 = 65 - $P27 = new .Undef + $P27 = new 'Undef' $P27 = add $P26, $P29 $I0 = $P27 $S0 = chr $I0 find_lex $P28 , "$s" - $P28 = new .Undef + $P28 = new 'Undef' $P28 = $S0 push $P22, $P28 inc $P29 @@ -56,7 +56,7 @@ for_1_start: for_1_end: # set up all 5 element permutations of qw( A B C D E F G H I J ) - $P29 = new .Undef + $P29 = new 'Undef' .lex "e", P29 $P29 = 0 for_2_start: @@ -70,18 +70,18 @@ for_3_start: $P32 = .ITERATE_FROM_START iter_1_start: unless $P32 goto iter_1_end - $P33 = new .Undef + $P33 = new 'Undef' $P33 = 65 - $P34 = new .Undef + $P34 = new 'Undef' add $P34, $P33, $P30 # 65 + $i $I0 = $P34 $S0 = chr $I0 - $P35 = new .Undef + $P35 = new 'Undef' $P35 = $S0 shift $P36, $P32 # $s # $P37 goes into the aggregate and can not be # pulled out of loop - $P37 = new .Undef + $P37 = new 'Undef' concat $P37, $P36, $P35 $P38 = find_lex "@nk" push $P38, $P37 diff --git a/examples/benchmarks/arriter_o1.pir b/examples/benchmarks/arriter_o1.pir index 7cc652b4a6..3ab65419d0 100644 --- a/examples/benchmarks/arriter_o1.pir +++ b/examples/benchmarks/arriter_o1.pir @@ -36,15 +36,15 @@ F. .include "iterator.pasm" # declaration of lexicals - $P20 = new .Hash + $P20 = new 'Hash' .lex "%ha", $P20 - $P21 = new .Undef + $P21 = new 'Undef' .lex "$i", $P21 - $P22 = new .ResizablePMCArray + $P22 = new 'ResizablePMCArray' .lex "@k", $P22 - $P23 = new .ResizablePMCArray + $P23 = new 'ResizablePMCArray' .lex "@nk", $P23 - $P24 = new .Undef + $P24 = new 'Undef' .lex "$s", $P24 # same as @k = qw( A B C D E F G H I J ); @@ -52,14 +52,14 @@ F. $P29 = 0 for_1_start: unless $P29 < 10 goto for_1_end - $P26 = new .Undef + $P26 = new 'Undef' $P26 = 65 - $P27 = new .Undef + $P27 = new 'Undef' $P27 = add $P26, $P29 $I0 = $P27 $S0 = chr $I0 find_lex $P28 , "$s" - $P28 = new .Undef + $P28 = new 'Undef' $P28 = $S0 push $P22, $P28 inc $P29 @@ -67,7 +67,7 @@ for_1_start: for_1_end: # set up all 5 element permutations of qw( A B C D E F G H I J ) - $P29 = new .Undef + $P29 = new 'Undef' .lex "e", P29 $P29 = 0 for_2_start: @@ -81,23 +81,23 @@ for_3_start: $P32 = .ITERATE_FROM_START # start of opt: invariant may go out of loop - $P33 = new .Undef + $P33 = new 'Undef' $P33 = 65 $P38 = find_lex "@nk" # end of opt iter_1_start: unless $P32 goto iter_1_end - $P34 = new .Undef + $P34 = new 'Undef' add $P34, $P33, $P30 # 65 + $i $I0 = $P34 $S0 = chr $I0 - $P35 = new .Undef + $P35 = new 'Undef' $P35 = $S0 shift $P36, $P32 # $s # $P37 goes into the aggregate and can not be # pulled out of loop - $P37 = new .Undef + $P37 = new 'Undef' concat $P37, $P36, $P35 push $P38, $P37 branch iter_1_start diff --git a/examples/benchmarks/bench_newp.pasm b/examples/benchmarks/bench_newp.pasm index 9ae1e5ec49..f9cae186d9 100644 --- a/examples/benchmarks/bench_newp.pasm +++ b/examples/benchmarks/bench_newp.pasm @@ -38,10 +38,10 @@ prints out some statistics indicating: set I3, 1000 set I0, I2 time N5 -loop: new P0, .ResizablePMCArray +loop: new P0, 'ResizablePMCArray' set P0, I3 set I1, 0 -fill: new P1, .Integer +fill: new P1, 'Integer' set P1, I1 set P0[I1], P1 inc I1 diff --git a/examples/benchmarks/freeze.pasm b/examples/benchmarks/freeze.pasm index 4c2a4b4e12..59535988a8 100644 --- a/examples/benchmarks/freeze.pasm +++ b/examples/benchmarks/freeze.pasm @@ -15,7 +15,7 @@ Freeze/thaw an ResizablePMCArray. =cut - new P0, .ResizablePMCArray + new P0, 'ResizablePMCArray' set I0, 100000 time N0 lp1: diff --git a/examples/benchmarks/mops.pasm b/examples/benchmarks/mops.pasm index fe48f11287..689574e829 100644 --- a/examples/benchmarks/mops.pasm +++ b/examples/benchmarks/mops.pasm @@ -16,11 +16,11 @@ C PMCs. =cut - new P1, .Integer - new P2, .Integer - new P3, .Integer - new P4, .Integer - new P5, .Integer + new P1, 'Integer' + new P2, 'Integer' + new P3, 'Integer' + new P4, 'Integer' + new P5, 'Integer' set P2, 0 set P3, 1 diff --git a/examples/benchmarks/oo1.pasm b/examples/benchmarks/oo1.pasm index d4d464c535..5c1c6b2583 100644 --- a/examples/benchmarks/oo1.pasm +++ b/examples/benchmarks/oo1.pasm @@ -62,11 +62,11 @@ loop: .include "interpinfo.pasm" interpinfo P2, .INTERPINFO_CURRENT_OBJECT classoffset I0, P2, "Foo" - new P10, .Integer + new P10, 'Integer' set P10, 10 setattribute P2, I0, P10 inc I0 - new P10, .Integer + new P10, 'Integer' set P10, 20 setattribute P2, I0, P10 returncc diff --git a/examples/benchmarks/oo2.pasm b/examples/benchmarks/oo2.pasm index 811e0d69c7..ca032e575f 100644 --- a/examples/benchmarks/oo2.pasm +++ b/examples/benchmarks/oo2.pasm @@ -49,11 +49,11 @@ loop: .include "interpinfo.pasm" interpinfo P2, .INTERPINFO_CURRENT_OBJECT classoffset I0, P2, "Foo" - new P10, .Integer + new P10, 'Integer' set P10, 10 setattribute P2, I0, P10 inc I0 - new P10, .Integer + new P10, 'Integer' set P10, 20 setattribute P2, I0, P10 returncc diff --git a/examples/benchmarks/oo3.pasm b/examples/benchmarks/oo3.pasm index fcf7de3f4e..b2f5a76b25 100644 --- a/examples/benchmarks/oo3.pasm +++ b/examples/benchmarks/oo3.pasm @@ -13,11 +13,11 @@ loop: classoffset I0, P3, "Foo" getattribute P2, P3, I0 - new P10, .Integer # x = Foo.i + new P10, 'Integer' # x = Foo.i assign P10, P2 inc I0 getattribute P2, P3, I0 - new P11, .Integer # y = Foo.j + new P11, 'Integer' # y = Foo.j assign P11, P2 inc I10 lt I10, I11, loop @@ -33,11 +33,11 @@ loop: .include "interpinfo.pasm" interpinfo P2, .INTERPINFO_CURRENT_OBJECT classoffset I0, P2, "Foo" - new P10, .Integer + new P10, 'Integer' set P10, 10 setattribute P2, I0, P10 inc I0 - new P10, .Integer + new P10, 'Integer' set P10, 20 setattribute P2, I0, P10 returncc diff --git a/examples/benchmarks/oo4.pasm b/examples/benchmarks/oo4.pasm index 104fbea7e8..beb17a849c 100644 --- a/examples/benchmarks/oo4.pasm +++ b/examples/benchmarks/oo4.pasm @@ -12,11 +12,11 @@ new P3, I12 loop: classoffset I0, P3, "Foo" - new P4, .Integer + new P4, 'Integer' set P4, I10 setattribute P3, I0, P4 inc I0 - new P4, .Integer + new P4, 'Integer' set P4, I10 setattribute P3, I0, P4 inc I10 @@ -33,11 +33,11 @@ loop: .include "interpinfo.pasm" interpinfo P2, .INTERPINFO_CURRENT_OBJECT classoffset I0, P2, "Foo" - new P10, .Integer + new P10, 'Integer' set P10, 10 setattribute P2, I0, P10 inc I0 - new P10, .Integer + new P10, 'Integer' set P10, 20 setattribute P2, I0, P10 returncc diff --git a/examples/benchmarks/oo5.pir b/examples/benchmarks/oo5.pir index 921f8c6aea..f197f11bf3 100644 --- a/examples/benchmarks/oo5.pir +++ b/examples/benchmarks/oo5.pir @@ -15,12 +15,12 @@ loop: $P4 = o."i"() .local pmc x - x = new .Integer + x = new 'Integer' assign x, $P4 $P5 = o."j"() .local pmc y - y = new .Integer + y = new 'Integer' assign y, $P5 inc i if i <= 500000 goto loop @@ -35,11 +35,11 @@ loop: .sub __init method .local int ofs ofs = classoffset self, "Foo" - new $P10, .Integer + new $P10, 'Integer' set $P10, 10 setattribute self, ofs, $P10 inc ofs - new $P10, .Integer + new $P10, 'Integer' set $P10, 20 setattribute self, ofs, $P10 .end diff --git a/examples/benchmarks/oo6.pir b/examples/benchmarks/oo6.pir index 8f1e4bb00d..dba4eda908 100644 --- a/examples/benchmarks/oo6.pir +++ b/examples/benchmarks/oo6.pir @@ -13,7 +13,7 @@ .local pmc o o = new typ loop: - $P4 = new .Integer + $P4 = new 'Integer' $P4 = i o."i"($P4) o."j"($P4) @@ -30,11 +30,11 @@ loop: .sub __init method .local int ofs ofs = classoffset self, "Foo" - new $P10, .Integer + new $P10, 'Integer' set $P10, 10 setattribute self, ofs, $P10 inc ofs - new $P10, .Integer + new $P10, 'Integer' set $P10, 20 setattribute self, ofs, $P10 .end diff --git a/examples/benchmarks/oofib.pir b/examples/benchmarks/oofib.pir index 2da636614d..f57639d594 100644 --- a/examples/benchmarks/oofib.pir +++ b/examples/benchmarks/oofib.pir @@ -5,7 +5,7 @@ .sym int argc argc = argv .sym pmc N - N = new .Integer + N = new 'Integer' N = 28 if argc <= 1 goto noarg $S0 = argv[1] @@ -53,13 +53,13 @@ rec: .sym pmc n2 .sym pmc r1 .sym pmc r2 - n1 = new .Integer - n2 = new .Integer + n1 = new 'Integer' + n2 = new 'Integer' n1 = n - 1 n2 = n - 2 r1 = self."fibA"(n1) r2 = self."fibB"(n2) - n = new .Integer + n = new 'Integer' n = r1 + r2 .pcc_begin_return .return n @@ -77,13 +77,13 @@ rec: .sym pmc n2 .sym pmc r1 .sym pmc r2 - n1 = new .Integer - n2 = new .Integer + n1 = new 'Integer' + n2 = new 'Integer' n1 = n - 1 n2 = n - 2 r1 = self."fib"(n1) r2 = self."fibB"(n2) - n = new .Integer + n = new 'Integer' n = r1 + r2 .pcc_begin_return .return n @@ -103,13 +103,13 @@ rec: .sym pmc n2 .sym pmc r1 .sym pmc r2 - n1 = new .Integer - n2 = new .Integer + n1 = new 'Integer' + n2 = new 'Integer' n1 = n - 1 n2 = n - 2 r1 = self."fib"(n1) r2 = self."fibA"(n2) - n = new .Integer + n = new 'Integer' n = r1 + r2 .pcc_begin_return .return n diff --git a/examples/benchmarks/primes.pasm b/examples/benchmarks/primes.pasm index 44b244afc5..88e14aa504 100644 --- a/examples/benchmarks/primes.pasm +++ b/examples/benchmarks/primes.pasm @@ -17,12 +17,12 @@ of primes, the last one found, and the time taken. =cut # I1 holds the number we're currently checking for primality - new P1, .Integer + new P1, 'Integer' set P1, 1 # I2 holds the highest number we want to check for primality - new P2, .Integer + new P2, 'Integer' set P2, 10000 - new P6, .Integer + new P6, 'Integer' set P6, 0 print "N primes up to " print P2 @@ -30,12 +30,12 @@ of primes, the last one found, and the time taken. time N10 # I1 counts up to I2 REDO: # I3 counts from 2 up to I4 (I1/2) - new P3, .Integer + new P3, 'Integer' set P3, 2 - new P4, .Integer + new P4, 'Integer' div P4, P1, 2 LOOP: # Check if I3 is a factor of I1 - new P5, .Integer + new P5, 'Integer' cmod P5, P1, P3 if P5, OK # We've found a factor, so it can't be a prime and diff --git a/examples/benchmarks/primes2.pasm b/examples/benchmarks/primes2.pasm index a713b36bf9..977e8dc93b 100644 --- a/examples/benchmarks/primes2.pasm +++ b/examples/benchmarks/primes2.pasm @@ -16,14 +16,14 @@ of primes and the last one found. =cut -new P1, .Integer +new P1, 'Integer' set P1, 0 -new P3, .Integer +new P3, 'Integer' set P3, 0 -new P4, .Integer +new P4, 'Integer' set P4, 5000 -new P6, .Integer -new P7, .Integer +new P6, 'Integer' +new P7, 'Integer' LOOP: save P1 @@ -52,25 +52,25 @@ PRIMECHECK: saveall restore P5 lt P5,1,ret0 -new P6, .Integer +new P6, 'Integer' assign P6,P5 dec P6 NLOOP: le P6, 1, ret1 -new P7, .Integer +new P7, 'Integer' cmod P7, P5, P6 eq P7, 0, ret0 dec P6 branch NLOOP # is prime ret1: - new P0, .Integer + new P0, 'Integer' set P0, 1 save P0 restoreall ret ret0: - new P0, .Integer + new P0, 'Integer' set P0, 0 save P0 restoreall diff --git a/examples/benchmarks/shared_ref.pasm b/examples/benchmarks/shared_ref.pasm index f25be7d223..7226ed3d67 100644 --- a/examples/benchmarks/shared_ref.pasm +++ b/examples/benchmarks/shared_ref.pasm @@ -18,8 +18,8 @@ Shares references between threads. set I0, 100000 set I1, 0 lp: - new P0, .Integer - new P1, .SharedRef, P0 # or .Ref + new P0, 'Integer' + new P1, 'SharedRef', P0 # or 'Ref' set P1, I1 inc I1 lt I1, I0, lp diff --git a/examples/benchmarks/stress.pasm b/examples/benchmarks/stress.pasm index da7b377758..e31b504fd2 100644 --- a/examples/benchmarks/stress.pasm +++ b/examples/benchmarks/stress.pasm @@ -17,7 +17,7 @@ total number of DOD runs made. =cut set I0, 10 - new P0, .ResizablePMCArray + new P0, 'ResizablePMCArray' ol: bsr buildarray set P0[I0], P1 @@ -27,7 +27,7 @@ ol: bsr buildarray if I0, ol set I0, 20 - new P2, .ResizablePMCArray + new P2, 'ResizablePMCArray' ol1: bsr buildarray set P2[I0], P1 @@ -37,7 +37,7 @@ ol1: bsr buildarray if I0, ol1 set I0, 20 - new P3, .ResizablePMCArray + new P3, 'ResizablePMCArray' ol2: bsr buildarray set P3[I0], P1 @@ -57,8 +57,8 @@ ol2: bsr buildarray # Our inner loop, 10000 times buildarray: set I1, 10000 - new P1, .ResizablePMCArray -loop1: new P9, .Integer + new P1, 'ResizablePMCArray' +loop1: new P9, 'Integer' set P9, I1 set P1[I1], P9 dec I1 diff --git a/examples/benchmarks/stress1.pasm b/examples/benchmarks/stress1.pasm index 073fbfa2f7..80210472c7 100644 --- a/examples/benchmarks/stress1.pasm +++ b/examples/benchmarks/stress1.pasm @@ -22,7 +22,7 @@ DOD runs made. mloop: set I0, 10 - new P0, .ResizablePMCArray + new P0, 'ResizablePMCArray' ol: bsr buildarray set P0[I0], P1 @@ -30,7 +30,7 @@ ol: bsr buildarray if I0, ol set I0, 20 - new P2, .ResizablePMCArray + new P2, 'ResizablePMCArray' ol1: bsr buildarray set P2[I0], P1 @@ -38,7 +38,7 @@ ol1: bsr buildarray if I0, ol1 set I0, 20 - new P3, .ResizablePMCArray + new P3, 'ResizablePMCArray' ol2: bsr buildarray set P3[I0], P1 @@ -64,9 +64,9 @@ ol2: bsr buildarray # Our inner loop, 20000 times buildarray: set I1, 20000 - new P1, .ResizablePMCArray + new P1, 'ResizablePMCArray' set P1, I1 # set length => fixed sized array -loop1: new P9, .Integer +loop1: new P9, 'Integer' set P9, I1 set P1[I1], P9 dec I1 diff --git a/examples/benchmarks/stress2.pasm b/examples/benchmarks/stress2.pasm index cc92c026de..db7310cef5 100644 --- a/examples/benchmarks/stress2.pasm +++ b/examples/benchmarks/stress2.pasm @@ -17,7 +17,7 @@ Creates 200 arrays of 10000 elements each. set I3, 20 ol: set I0, 10 - new P0, .ResizablePMCArray + new P0, 'ResizablePMCArray' ol1: bsr buildarray set P0[I0], P1 @@ -31,8 +31,8 @@ ol1: bsr buildarray buildarray: set I1, 10000 - new P1, .ResizablePMCArray -loop1: new P2, .Integer + new P1, 'ResizablePMCArray' +loop1: new P2, 'Integer' set P2, I1 set P1[I1], P2 dec I1 diff --git a/examples/benchmarks/stress3.pasm b/examples/benchmarks/stress3.pasm index 3014ce9303..ec829f5504 100644 --- a/examples/benchmarks/stress3.pasm +++ b/examples/benchmarks/stress3.pasm @@ -39,7 +39,7 @@ at the moment: set I11, 0 noarg: set I0, 100 - new P0, .ResizablePMCArray + new P0, 'ResizablePMCArray' ol: bsr buildarray set P0[I0], P1 @@ -48,12 +48,12 @@ ol: bsr buildarray # now check reusage, destroy them depending on I11 unless I11, no_dest - new P0, .Undef + new P0, 'Undef' no_dest: set I0, 5000000 - new P3, .ResizablePMCArray + new P3, 'ResizablePMCArray' l2: - new P1, .Integer + new P1, 'Integer' set P3[0], P1 dec I0 if I0, l2 @@ -75,8 +75,8 @@ l2: # Our inner loop, 10000 times buildarray: set I1, 10000 - new P1, .ResizablePMCArray -loop1: new P9, .Integer + new P1, 'ResizablePMCArray' +loop1: new P9, 'Integer' set P9, I1 set P1[I1], P9 dec I1 diff --git a/examples/io/async_select.pir b/examples/io/async_select.pir index e3a2486ca0..c443634bc5 100644 --- a/examples/io/async_select.pir +++ b/examples/io/async_select.pir @@ -29,7 +29,7 @@ available. pio = getstdin $S0 = pop pio # unbuffer - data = new .Integer + data = new 'Integer' data = 42 .const .Sub handler = "io_handler" pio_out = getstdout diff --git a/examples/io/httpd.pir b/examples/io/httpd.pir index c03b6cbe5d..7921b20ea8 100644 --- a/examples/io/httpd.pir +++ b/examples/io/httpd.pir @@ -358,7 +358,7 @@ cgi_1: no_query: file = url query = '' - query_hash = new .Hash + query_hash = new 'Hash' have_query: # escape % file = urldecode(file) @@ -391,7 +391,7 @@ cgi_file: .param string query # the unescapced one .local pmc query_hash, items .local string kv, k, v - query_hash = new .Hash + query_hash = new 'Hash' items = split '+', query .local int i, n i = 0 diff --git a/examples/japh/japh8.pasm b/examples/japh/japh8.pasm index fb1d946400..770b3cfec2 100644 --- a/examples/japh/japh8.pasm +++ b/examples/japh/japh8.pasm @@ -1,11 +1,11 @@ # $Id$ # Little Endian only using struct - new P1, .ResizablePMCArray + new P1, 'ResizablePMCArray' push P1, -100 push P1, 28 push P1, I0 - new P0, .ManagedStruct, P1 + new P0, 'ManagedStruct', P1 set P0[0], 1953723722 set P0[0;1], 1869504800 set P0[0;2], 1919248500 diff --git a/examples/library/ncurses_life.pir b/examples/library/ncurses_life.pir index 6f4499fcef..2eaddc9686 100644 --- a/examples/library/ncurses_life.pir +++ b/examples/library/ncurses_life.pir @@ -634,11 +634,11 @@ f1: not_P: if $S0 != "A" goto not_A # absolute format = ABS - points = new .ResizableIntegerArray + points = new 'ResizableIntegerArray' not_A: if $S0 != "R" goto not_R # relative format = REL - points = new .ResizableIntegerArray + points = new 'ResizableIntegerArray' not_R: goto loop diff --git a/examples/namespace/namespace_dump.pir b/examples/namespace/namespace_dump.pir index 343768fb0c..289f51f251 100644 --- a/examples/namespace/namespace_dump.pir +++ b/examples/namespace/namespace_dump.pir @@ -36,7 +36,7 @@ lp: no_sym: $I0 = typeof $P0 if $I0 != .NCI goto no_nci - $P0 = new .String + $P0 = new 'String' $P0 = "NCI" no_nci: print spac diff --git a/examples/nci/ls.pir b/examples/nci/ls.pir index ed4455f17c..d99f70cc31 100644 --- a/examples/nci/ls.pir +++ b/examples/nci/ls.pir @@ -28,7 +28,7 @@ List the content of the directory 'docs'. .local OrderedHash entry .include "datatypes.pasm" - new $P2, .OrderedHash + new $P2, 'OrderedHash' set $P2["d_fileno"], .DATATYPE_INT64 push $P2, 0 push $P2, 0 diff --git a/examples/pasm/nanoforth.pasm b/examples/pasm/nanoforth.pasm index fa90391dc0..d8515bd8f4 100644 --- a/examples/pasm/nanoforth.pasm +++ b/examples/pasm/nanoforth.pasm @@ -27,7 +27,7 @@ checking is disabled. .endm _main: - new P16, .Hash + new P16, 'Hash' .core("+", _add) .core("-", _sub) .core(".", _print) diff --git a/examples/pasm/nanoforth2.pasm b/examples/pasm/nanoforth2.pasm index 9c6bd5062e..5ac0a026b8 100644 --- a/examples/pasm/nanoforth2.pasm +++ b/examples/pasm/nanoforth2.pasm @@ -34,7 +34,7 @@ _main: .pcc_sub _nano_forth_compiler: set S17, S5 #input src code - new P6, .Hash + new P6, 'Hash' .core("+", "_add") .core("-", "_sub") .core(".", "_print") @@ -49,8 +49,8 @@ _main: .core("8", "_const") .core("9", "_const") # .core(":", "_start_compile") - new P5, .ResizablePMCArray - new P10, .Integer + new P5, 'ResizablePMCArray' + new P10, 'Integer' store_global "compiling", P10 #set S17, ": a + ; 2 1 a ." diff --git a/examples/past/01-sub.pir b/examples/past/01-sub.pir index 24a55264e4..7b8324c195 100644 --- a/examples/past/01-sub.pir +++ b/examples/past/01-sub.pir @@ -44,7 +44,7 @@ .param pmc args :slurpy if null args goto end .local pmc iter - iter = new .Iterator, args + iter = new 'Iterator', args loop: unless iter goto end $P0 = shift iter diff --git a/examples/pir/hanoi.pir b/examples/pir/hanoi.pir index cbde99e184..ab47d33d42 100644 --- a/examples/pir/hanoi.pir +++ b/examples/pir/hanoi.pir @@ -109,11 +109,11 @@ USE_DEFAULT_SIZE: SIZE_IS_NOW_KNOWN: print "\n" - new P0, .FixedPMCArray + new P0, 'FixedPMCArray' set P0, 3 - new P1, .ResizableIntegerArray - new P2, .ResizableIntegerArray - new P3, .ResizableIntegerArray + new P1, 'ResizableIntegerArray' + new P2, 'ResizableIntegerArray' + new P3, 'ResizableIntegerArray' set P0[0], P1 #P0 = [[],[],[]] set P0[1], P2 set P0[2], P3 diff --git a/examples/pir/levenshtein.pir b/examples/pir/levenshtein.pir index ae8e70f2ec..3590cdce03 100644 --- a/examples/pir/levenshtein.pir +++ b/examples/pir/levenshtein.pir @@ -43,10 +43,10 @@ if n == 0 goto return_m if m == 0 goto return_n - new matrix, .ResizablePMCArray + new matrix, 'ResizablePMCArray' i = 0 init_matrix: - new $P0, .ResizableIntegerArray + new $P0, 'ResizableIntegerArray' matrix[i] = $P0 i += 1 if i <= m goto init_matrix diff --git a/examples/pir/queens_r.pir b/examples/pir/queens_r.pir index a7cbcc734c..b28e999c97 100644 --- a/examples/pir/queens_r.pir +++ b/examples/pir/queens_r.pir @@ -8,8 +8,8 @@ $Id$ .sub main :main .local pmc queen_row, queen_state - queen_row = new .ResizableIntegerArray - queen_state = new .ResizableIntegerArray + queen_row = new 'ResizableIntegerArray' + queen_state = new 'ResizableIntegerArray' solve(0, queen_row, queen_state) .end diff --git a/examples/pir/quine_ord.pir b/examples/pir/quine_ord.pir index d364772e64..594aac36be 100644 --- a/examples/pir/quine_ord.pir +++ b/examples/pir/quine_ord.pir @@ -4,7 +4,7 @@ .param pmc argv .local pmc code_as_data - code_as_data = new .ResizableIntegerArray + code_as_data = new 'ResizableIntegerArray' # ------ Start of data section ------ push code_as_data, 35 push code_as_data, 32 @@ -1028,7 +1028,7 @@ push code_as_data, 110 push code_as_data, 101 push code_as_data, 119 push code_as_data, 32 -push code_as_data, 46 +push code_as_data, 39 push code_as_data, 82 push code_as_data, 101 push code_as_data, 115 @@ -1050,6 +1050,7 @@ push code_as_data, 114 push code_as_data, 114 push code_as_data, 97 push code_as_data, 121 +push code_as_data, 39 push code_as_data, 92 push code_as_data, 110 push code_as_data, 34 @@ -2162,7 +2163,7 @@ push code_as_data, 110 push code_as_data, 101 push code_as_data, 119 push code_as_data, 32 -push code_as_data, 46 +push code_as_data, 39 push code_as_data, 73 push code_as_data, 116 push code_as_data, 101 @@ -2171,6 +2172,7 @@ push code_as_data, 97 push code_as_data, 116 push code_as_data, 111 push code_as_data, 114 +push code_as_data, 39 push code_as_data, 44 push code_as_data, 32 push code_as_data, 100 @@ -2603,7 +2605,7 @@ push code_as_data, 110 push code_as_data, 101 push code_as_data, 119 push code_as_data, 32 -push code_as_data, 46 +push code_as_data, 39 push code_as_data, 73 push code_as_data, 116 push code_as_data, 101 @@ -2612,6 +2614,7 @@ push code_as_data, 97 push code_as_data, 116 push code_as_data, 111 push code_as_data, 114 +push code_as_data, 39 push code_as_data, 44 push code_as_data, 32 push code_as_data, 100 @@ -3532,7 +3535,7 @@ DO_QUINE: print " .param pmc argv\n" print "\n" print " .local pmc code_as_data\n" - print " code_as_data = new .ResizableIntegerArray\n" + print " code_as_data = new 'ResizableIntegerArray'\n" print "# ------ Start of data section ------\n" # Now the data @@ -3581,7 +3584,7 @@ DO_QUINE: .local pmc iter .local int char_int - iter = new .Iterator, data + iter = new 'Iterator', data iter = .ITERATE_FROM_START # reset iterator, begin at start ITER_LOOP: unless iter goto ITER_END # while (entries) ... @@ -3600,7 +3603,7 @@ DO_QUINE: .include "iterator.pasm" .local pmc iter - iter = new .Iterator, data + iter = new 'Iterator', data iter = .ITERATE_FROM_START # reset iterator, begin at start .local int char_int diff --git a/examples/pir/sudoku.pir b/examples/pir/sudoku.pir index f80dff9460..5d7aee1f52 100644 --- a/examples/pir/sudoku.pir +++ b/examples/pir/sudoku.pir @@ -215,7 +215,7 @@ nc_stop: nok: # need backtracking .local pmc tries, all - tries = new .ResizablePMCArray + tries = new 'ResizablePMCArray' all = getattribute self, "all" push tries, all $I0 = self."back_track"(tries) @@ -338,7 +338,7 @@ some: if name goto sel_name list_names: - new it, .Iterator, b + new it, 'Iterator', b it = .ITERATE_FROM_START loop: unless it goto fin @@ -521,7 +521,7 @@ not_set: i = length raw if i != 81 goto len_err .local pmc ar - ar = new .FixedIntegerArray + ar = new 'FixedIntegerArray' ar = 81 i = 0 loop: @@ -583,7 +583,7 @@ check_nc: .param string what .local pmc rcss, rcs, all - rcss = new .FixedPMCArray + rcss = new 'FixedPMCArray' rcss = 9 setattribute self, what, rcss all = getattribute self, "all" @@ -593,7 +593,7 @@ check_nc: # create arrays y = 0 ly1: - rcs = new .FixedPMCArray + rcs = new 'FixedPMCArray' rcs = 9 rcss[y] = rcs inc y @@ -634,9 +634,9 @@ lx2: c = ar[p] # the entries 'e' and 'inv' are common to all 3 views of the sudoku - e = new .Integer + e = new 'Integer' e = c - inv = new .Integer + inv = new 'Integer' # set row row = rows[y] @@ -867,7 +867,7 @@ err: y = 0 lpy: one = rcss[y] - seen = new .Hash + seen = new 'Hash' x = 0 lpx: e = one[x] @@ -900,7 +900,7 @@ ret_0: .sub check_seen .param pmc seen .local pmc it - new it, .Iterator, seen + new it, 'Iterator', seen it = .ITERATE_FROM_START loop: unless it goto ok @@ -985,12 +985,12 @@ nxt_n: # transpose into a digit-base array with positions as bits # this should simplify the test for 2 empty squares with # same digit - digs = new .FixedPMCArray + digs = new 'FixedPMCArray' digs = 9 n = 0 lpn: msk = 2 << n - d = new .Integer + d = new 'Integer' digs[n] = d x = 0 # don't bother looking further if n is already set @@ -1013,7 +1013,7 @@ nxt_n: x1 = 0 lpx1: - empty_2 = new .ResizablePMCArray + empty_2 = new 'ResizablePMCArray' e1 = digs[x1] n = bits0(e1) if n != 2 goto nxt_x1 @@ -1604,7 +1604,7 @@ lpn: # when scanning cols, sx is horizontal # need 3 cols at a time lpsx: - bits = new .FixedIntegerArray + bits = new 'FixedIntegerArray' bits = 3 x = 0 lpx: diff --git a/examples/sdl/bounce_parrot_logo.pir b/examples/sdl/bounce_parrot_logo.pir index c58748aca5..bb4eaa08e9 100644 --- a/examples/sdl/bounce_parrot_logo.pir +++ b/examples/sdl/bounce_parrot_logo.pir @@ -82,7 +82,7 @@ Use the Escape key or close the window when you've had enough. event.'init'() .local pmc handler_args - handler_args = new .Hash + handler_args = new 'Hash' handler_args[ 'screen' ] = main_screen handler_args[ 'sprite' ] = sprite diff --git a/examples/sdl/lcd/clock.pir b/examples/sdl/lcd/clock.pir index d89b30a3d3..e73d5d5248 100644 --- a/examples/sdl/lcd/clock.pir +++ b/examples/sdl/lcd/clock.pir @@ -30,20 +30,20 @@ The main function. load_bytecode "library/SDL/Event.pir" load_bytecode "library/SDL/EventHandler.pir" load_bytecode "library/SDL/LCD.pir" - + # set some screen properties - $P0 = new .Hash + $P0 = new 'Hash' $P0["height"] = 21 $P0["width"] = 94 $P0["bpp"] = 16 $P0["flags"] = 5 - + # create the SDL application object $I0 = find_type "SDL::App" $P0 = new $I0, $P0 $P0 = $P0."surface"() global "screen" = $P0 - + # create the LCD $I0 = find_type "SDL::LCD" $P0 = new $I0 @@ -51,10 +51,10 @@ The main function. # draw the watch drawWatch() - + # create the timer $P1 = global "drawWatch" - $P0 = new .Timer + $P0 = new 'Timer' $P0[.PARROT_TIMER_NSEC] = 0.5 $P0[.PARROT_TIMER_HANDLER] = $P1 $P0[.PARROT_TIMER_REPEAT] = -1 @@ -62,7 +62,7 @@ The main function. # store the timer somewhere, it will be # collected and destroyed otherwise global "timer" = $P0 - + # # event loop # @@ -94,7 +94,7 @@ Creates, sets and redraws the LCD display content. if $N0 < 0.5 goto USE_DOTS $S2 = " " USE_DOTS: - + # hours $I0 = $P0[.TM_HOUR] $I0 /= 10 diff --git a/examples/sdl/mandel.pir b/examples/sdl/mandel.pir index 2941e33db3..c44d79acb2 100644 --- a/examples/sdl/mandel.pir +++ b/examples/sdl/mandel.pir @@ -14,7 +14,7 @@ To run this file, run the following command from the Parrot directory: =head2 Options --quit, -q ... quit immediately (useful for benchmarking) - --threads ... non-working code to run 2 calculation threads + --threads ... non-working code to run 2 calculation threads =head1 KEYBOARD/MOUSE COMMANDS @@ -42,10 +42,10 @@ To run this file, run the following command from the Parrot directory: event.'process_events'(handler, app) ex: app.'quit'() -.end +.end # utils -.sub 'load_libs' +.sub 'load_libs' # load the necessary libraries load_bytecode "library/SDL/App.pir" load_bytecode "library/SDL/Rect.pir" @@ -88,7 +88,7 @@ ex: app = new 'Mandel' setattribute app, 'opts', opts .return (app) -.end +.end .namespace ['Mandel'] @@ -104,22 +104,22 @@ ex: w = 600 h = 400 self.'init'( 'height' => h, 'width' => w, 'bpp' => 0, 'flags' => 1 ) - $P0 = new .Float + $P0 = new 'Float' $P0 = xstart setattribute self, 'xstart', $P0 - $P0 = new .Float + $P0 = new 'Float' $P0 = ystart setattribute self, 'ystart', $P0 - $P0 = new .Float + $P0 = new 'Float' $P0 = 1.0 # XXX calc from above setattribute self, 'xend', $P0 - $P0 = new .Float + $P0 = new 'Float' $P0 = 1.0 setattribute self, 'yend', $P0 - $P0 = new .Float + $P0 = new 'Float' $P0 = scale setattribute self, 'scale', $P0 - $P0 = new .Integer + $P0 = new 'Integer' $P0 = 200 setattribute self, 'limit', $P0 @@ -231,7 +231,7 @@ get: pixels = main_screen.'pixels'() # start calculation .local pmc args - args = new .FixedPMCArray + args = new 'FixedPMCArray' set args, 10 args[0] = w args[1] = xstart @@ -250,7 +250,7 @@ get: .local pmc thr .local int h2 h2 = h / 2 - thr = new .ParrotThread + thr = new 'ParrotThread' .const .Sub raw_calc_f = 'raw_calc' .include 'cloneflags.pasm' .local int flags @@ -294,7 +294,7 @@ loop_y: x = 0 loop_x: c = x / scale # re c part - c += xstart + c += xstart z = 0.0 Z = 0.0 # Z(0) = 0 k = 0 @@ -328,7 +328,7 @@ set_pix: $I0 = k % pal_elems raw_c = raw_palette[$I0] $I0 = offs_y + x - # main_screen.'draw_pixel'(x, y, raw_c) --> + # main_screen.'draw_pixel'(x, y, raw_c) --> pixels[0; $I0] = raw_c inc x if x < w goto loop_x @@ -376,7 +376,7 @@ set_pix: if but == 2 goto done ds = 0.5 goto done -zoom_in: +zoom_in: ds = 2.0 done: dx2 /= ds @@ -438,13 +438,13 @@ done: main_screen = self.'surface'() .local int r, g, b, color_type find_type color_type, 'SDL::Color' - palette = new .ResizablePMCArray + palette = new 'ResizablePMCArray' r = 0 loop_r: g = 0 -loop_g: +loop_g: b = 0 -loop_b: +loop_b: col = new color_type col.'init'( 'r' => r, 'g' => g, 'b' => b ) push palette, col @@ -466,10 +466,10 @@ loop_b: .local pmc raw_palette, col, main_screen main_screen = self.'surface'() n = elements palette - raw_palette = new .FixedIntegerArray + raw_palette = new 'FixedIntegerArray' raw_palette = n i = 0 -loop: +loop: col = palette[i] raw_c = col.'color_for_surface'( main_screen ) raw_palette[i] = raw_c @@ -549,8 +549,8 @@ Plain runcore and unoptimized parrot: Original version based on sdl/raw_pixels 21s Create raw_palette 12s Prefetch raw_surface 10s [1] - Optimize calculation loop (zz, ZZ) 9s [2] - use raw pixels array [3] + Optimize calculation loop (zz, ZZ) 9s [2] + use raw pixels array [3] =head2 Parrot based optimizations diff --git a/examples/sdl/minesweeper/field.pir b/examples/sdl/minesweeper/field.pir index 3cead5ec1d..4d4ffc48fa 100644 --- a/examples/sdl/minesweeper/field.pir +++ b/examples/sdl/minesweeper/field.pir @@ -7,7 +7,7 @@ Mines::Field - A minesweeper field =head1 SYNOPSIS # setup field properties - $P0 = new .Hash + $P0 = new 'Hash' $P0['width'] = 40 $P0['height'] = 28 $P0['mines'] = 0.1075 @@ -130,8 +130,8 @@ SDL surface to use for drawing. mines = args['mines'] screen = args['screen'] debug = args['debug'] - field = new .ResizablePMCArray - cache = new .ResizablePMCArray + field = new 'ResizablePMCArray' + cache = new 'ResizablePMCArray' $I0 = find_type 'SDL::StopWatch' watch = new $I0, screen @@ -162,31 +162,31 @@ SDL surface to use for drawing. # width inc $I0 - $P0 = new .Integer + $P0 = new 'Integer' $P0 = width setattribute self, $I0, $P0 - + # height inc $I0 - $P0 = new .Integer + $P0 = new 'Integer' $P0 = height setattribute self, $I0, $P0 # mines inc $I0 - $P0 = new .Float + $P0 = new 'Float' $P0 = mines setattribute self, $I0, $P0 # markpos inc $I0 - $P0 = new .Integer + $P0 = new 'Integer' $P0 = -1 setattribute self, $I0, $P0 # debug inc $I0 - $P0 = new .Integer + $P0 = new 'Integer' $P0 = debug setattribute self, $I0, $P0 @@ -200,19 +200,19 @@ SDL surface to use for drawing. # button inc $I0 - $P0 = new .String + $P0 = new 'String' $P0 = "examples/sdl/minesweeper/smiley.png" $I1 = find_type "SDL::Button" $P0 = new $I1, $P0 $P0.'states'( 5 ) $P0.'pos'( 305, 2 ) $P0.'size'( 30, 30 ) - + $P1 = find_global 'Mines::Field', '_button_clicked' $P0.'setAction'( STATUS_PLAYING, $P1 ) $P0.'setAction'( STATUS_WON, $P1 ) $P0.'setAction'( STATUS_LOST, $P1 ) - + setattribute self, $I0, $P0 self.'newLevel'( level ) @@ -248,7 +248,7 @@ Creates a new level, with the given number as initial seed for the PRNG. add $I0, 2 $P0 = getattribute self, $I0 width = $P0 - + # height inc $I0 $P0 = getattribute self, $I0 @@ -263,15 +263,15 @@ Creates a new level, with the given number as initial seed for the PRNG. field = 0 cache = 0 - + # fill the field LOOP: level += size - + $I0 = level shl $I0, 13 $I0 = or $I0, level - + $I1 = $I0 * $I0 $I1 *= 15731 $I1 += 789221 @@ -286,7 +286,7 @@ LOOP: $I0 = $N0 $N0 = $N0 - $I0 level += $I0 - + val = VAL_UNEXPLORED_NO_MINE ge $N0, mines, NO_MINE val = VAL_UNEXPLORED_MINE @@ -294,7 +294,7 @@ NO_MINE: push field, val push cache, VAL_INVALID - + dec size if size <= 0 goto END branch LOOP @@ -349,7 +349,7 @@ Draws the field, then the LCDs and the smiley button. # screen inc $I0 screen = getattribute self, $I0 - + # width inc $I0 $P0 = getattribute self, $I0 @@ -377,7 +377,7 @@ DEBUG: image = find_global "Mines::Field", "field_debug" IMAGE_OK: $I0 = find_type "SDL::Rect" - $P0 = new .Hash + $P0 = new 'Hash' $P0['x'] = 0 $P0['y'] = 0 $P0['width'] = 0 @@ -398,7 +398,7 @@ LOOP: $I0 = $P0 $P0 = shift cacheit $I1 = $P0 - + # current field already drawn? if $I0 == $I1 goto NEXT @@ -406,10 +406,10 @@ LOOP: $I1 = cmod i, width $I2 = div i, width - + mul $I1, FIELD_WIDTH mul $I2, FIELD_HEIGHT - + add $I1, 0 add $I2, 32 @@ -431,16 +431,16 @@ SKIP3: if $I2 < maxy goto SKIP4 maxy = $I2 SKIP4: - + $I1 = cmod $I0, 5 $I2 = div $I0, 5 mul $I1, FIELD_WIDTH mul $I2, FIELD_HEIGHT - + src_rect.'x'( $I1 ) src_rect.'y'( $I2 ) - + screen.'blit'( image, src_rect, dest_rect ) NEXT: inc i @@ -452,7 +452,7 @@ END: if maxx <= minx goto NO_SCREEN_UPDATE if maxy <= miny goto NO_SCREEN_UPDATE - + dest_rect.'x'( minx ) dest_rect.'y'( miny ) $I0 = maxx - minx @@ -492,7 +492,7 @@ Returns 1 if successful, 0 otherwise. .local pmc watch self."undo_mark"() - + $I0 = classoffset self, 'Mines::Field' # width @@ -508,21 +508,21 @@ Returns 1 if successful, 0 otherwise. # watch add $I0, 5 watch = getattribute self, $I0 - + # status inc $I0 $P0 = getattribute self, $I0 if $P0 > STATUS_CHOOSING goto END - + x -= 0 y -= 32 if x < 0 goto END if y < 0 goto END - + x /= FIELD_WIDTH - y /= FIELD_HEIGHT - + y /= FIELD_HEIGHT + watch.'start'() self.'reveal_recursive'( x, y, width, height ) self.'check_end'() @@ -552,7 +552,7 @@ Returns 1 if successful, 0 otherwise. .local int v self."undo_mark"() - + $I0 = classoffset self, 'Mines::Field' # field @@ -567,7 +567,7 @@ Returns 1 if successful, 0 otherwise. # watch add $I0, 6 watch = getattribute self, $I0 - + # status inc $I0 $P0 = getattribute self, $I0 @@ -581,10 +581,10 @@ Returns 1 if successful, 0 otherwise. x /= FIELD_WIDTH y /= FIELD_HEIGHT - + pos = y * width pos += x - + v = field[pos] if v == VAL_FLAG_NO_MINE goto PLUS2 @@ -598,10 +598,10 @@ Returns 1 if successful, 0 otherwise. PLUS2: v += 2 branch DRAW - + MINUS4: v -= 4 - + DRAW: field[pos] = v @@ -646,8 +646,8 @@ This method returns nothing. .local pmc markpos .local pmc field .local pmc status - - + + $I0 = classoffset self, 'Mines::Field' # field @@ -694,9 +694,9 @@ removed if you call this method. .local pmc watch .local int pos .local int v - + self."undo_mark"() - + $I0 = classoffset self, 'Mines::Field' # field @@ -718,7 +718,7 @@ removed if you call this method. # watch add $I0, 3 watch = getattribute self, $I0 - + # status inc $I0 $P0 = getattribute self, $I0 @@ -729,7 +729,7 @@ removed if you call this method. x /= FIELD_WIDTH y /= FIELD_HEIGHT - + pos = y * width pos += x @@ -788,16 +788,16 @@ The horizontal mouse position. if y > 32 goto END $I0 = classoffset self, 'Mines::Field' - + add $I0, 10 $P0 = getattribute self, $I0 $I0 = $P0.'click'( x, y, b, self ) unless $I0 goto END - + $I0 = classoffset self, 'Mines::Field' add $I0, 2 $P1 = getattribute self, $I0 - + $P0.draw( $P1 ) END: @@ -824,16 +824,16 @@ have to be specified for performance reasons. if y < 0 goto END if x >= width goto END if y >= height goto END - + pos = y * width pos += x $I0 = classoffset self, 'Mines::Field' - + # field $P0 = getattribute self, $I0 field = $P0 - + $I0 = field[pos] if $I0 == VAL_FREE goto END if $I0 == VAL_UNEXPLORED_NO_MINE goto UNEXPLORED @@ -891,7 +891,7 @@ Shows the position of all mines on the field. .local pmc field .local int i .local int max - + self."setStatus"( STATUS_LOST ) classoffset $I0, self, "Mines::Field" @@ -901,7 +901,7 @@ Shows the position of all mines on the field. i = 0 LOOP: if i >= max goto END - + $I1 = field[i] if $I1 == VAL_UNEXPLORED_MINE goto MINE @@ -909,14 +909,14 @@ LOOP: if $I1 == VAL_FLAG_NO_MINE goto NO_MINE branch NEXT -MINE: +MINE: $I1 = VAL_MINE branch NEXT -NO_MINE: +NO_MINE: $I1 = VAL_NO_MINE branch NEXT - + NEXT: field[i] = $I1 inc i @@ -942,18 +942,18 @@ Checks if you have won. .sub check_end :method .local pmc field - + classoffset $I0, self, "Mines::Field" getattribute field, self, $I0 - field = new .Iterator, field + field = new 'Iterator', field field = .ITERATE_FROM_START LOOP: unless field goto WON - + $I0 = shift field if $I0 <= 8 goto LOOP - + if $I0 == VAL_MINE goto END if $I0 == VAL_MINE_EXPLODED goto END if $I0 == VAL_UNSURE_MINE goto END @@ -980,7 +980,7 @@ Sets a new game status. .local pmc screen .local pmc watch .local pmc status - + classoffset $I0, self, "Mines::Field" # screen @@ -994,7 +994,7 @@ Sets a new game status. # status inc $I0 status = getattribute self, $I0 - + if s == STATUS_PLAYING goto OK if s == STATUS_CHOOSING goto OK # not playing at the moment, stop the watch @@ -1002,10 +1002,10 @@ Sets a new game status. OK: # no need to start the watch here - status = s + status = s self."undo_mark"( 1 ) watch.'draw'( screen ) - + DONE: .end @@ -1020,16 +1020,16 @@ Counts the unrevealed mines and updates the LCD. .local int size .local pmc count .local pmc mines_lcd - + classoffset $I0, self, "Mines::Field" getattribute field, self, $I0 add $I0, 8 getattribute mines_lcd, self, $I0 - + size = field - field = new .Iterator, field + field = new 'Iterator' field field = .ITERATE_FROM_START - count = new .ResizablePMCArray + count = new 'ResizablePMCArray' LOOP: unless field goto END @@ -1046,7 +1046,7 @@ END: $I3 = count[VAL_MINE] $I4 = count[VAL_MINE_EXPLODED] $I5 = count[VAL_MARK_MINE] - + $I0 += $I1 $I0 -= $I2 $I0 += $I3 @@ -1089,13 +1089,13 @@ This method is called automatically when this module is loaded. # XXX: remove load_bytecode "library/Data/Dumper.pir" - $P0 = new .String + $P0 = new 'String' $P0 = "examples/sdl/minesweeper/mines.png" - $I0 = find_type "SDL::Image" + $I0 = find_type "SDL::Image" image = new $I0, $P0 store_global "Mines::Field", "field", image - $P0 = new .String + $P0 = new 'String' $P0 = "examples/sdl/minesweeper/mines_debug.png" image = new $I0, $P0 store_global "Mines::Field", "field_debug", image @@ -1137,9 +1137,9 @@ The width and height are the dimensions of the board. .local int j .local int j2 .local int pos - + mines = 0 - + set i1, x dec i1 set i2, x @@ -1161,10 +1161,10 @@ LOOPi: pos = j * width pos += i - + $I0 = _mine_at( field, pos ) unless $I0 goto NEXTi - + inc mines NEXTi: @@ -1173,7 +1173,7 @@ NEXTi: ENDi: inc j if j <= j2 goto LOOPj - + .return (mines) .end @@ -1188,7 +1188,7 @@ at the specified position, 0 otherwise. .param pmc field .param int pos .local int v - + v = field[pos] if v == VAL_MINE goto MINE if v == VAL_MINE_EXPLODED goto MINE diff --git a/examples/sdl/minesweeper/mines.pir b/examples/sdl/minesweeper/mines.pir index 5da6b3f4de..ede1865e7f 100644 --- a/examples/sdl/minesweeper/mines.pir +++ b/examples/sdl/minesweeper/mines.pir @@ -39,7 +39,7 @@ The main function. load_bytecode "examples/sdl/minesweeper/field.pir" # setup the screen properties - $P0 = new .Hash + $P0 = new 'Hash' $P0["height"] = 480 $P0["width"] = 640 $P0["bpp"] = 32 @@ -54,7 +54,7 @@ The main function. $I0 = time # setup field properties - $P0 = new .Hash + $P0 = new 'Hash' $P0['width'] = 40 $P0['height'] = 28 $P0['mines'] = 0.1075 diff --git a/examples/sdl/move_parrot_logo.pir b/examples/sdl/move_parrot_logo.pir index 807535fb8d..533921e396 100644 --- a/examples/sdl/move_parrot_logo.pir +++ b/examples/sdl/move_parrot_logo.pir @@ -77,7 +77,7 @@ To run this file, run the following command from the Parrot directory: event.'init'() .local pmc handler_args - handler_args = new .Hash + handler_args = new 'Hash' handler_args[ 'screen' ] = main_screen handler_args[ 'sprite' ] = sprite diff --git a/examples/sdl/tetris/app.pir b/examples/sdl/tetris/app.pir index f3d3812d4e..84557ef3ff 100644 --- a/examples/sdl/tetris/app.pir +++ b/examples/sdl/tetris/app.pir @@ -65,7 +65,7 @@ it parent classes nor is it subclassed. addattribute $P0, "Boards" # set the BUILD method name - $P1 = new .String + $P1 = new 'String' $P1 = 'BUILD' setprop $P0, 'BUILD', $P1 END: @@ -92,11 +92,11 @@ This method throws an exception if an error occurs. classoffset $I0, self, "Tetris::App" add $I0, tDebugFlags - $P0 = new .Hash + $P0 = new 'Hash' setattribute self, $I0, $P0 # prepare SDL's constructor arguments - $P0 = new .Hash + $P0 = new 'Hash' $P0["height"] = 480 $P0["width"] = 640 $P0["bpp"] = 32 @@ -125,7 +125,7 @@ This method throws an exception if an error occurs. setattribute self, $I0, $P0 # create the debug flags hash - $P0 = new .Hash + $P0 = new 'Hash' classoffset $I0, self, "Tetris::App" add $I0, tDebugFlags setattribute self, $I0, $P0 @@ -227,20 +227,20 @@ An exeption is thrown if an error occurs. $P0[6] = .PARROT_TIMER_RUNNING $P0[7] = 1 - $P1 = new .Timer, $P0 + $P1 = new 'Timer', $P0 classoffset $I0, self, "Tetris::App" add $I0, tTimer setattribute self, $I0, $P1 sub $I0, tTimer - $P0 = new .Integer + $P0 = new 'Integer' $P0 = 1 add $I0, tTimerDisableCount setattribute self, $I0, $P0 sub $I0, tTimerDisableCount - $P0 = new .Integer + $P0 = new 'Integer' $P0 = 0 add $I0, tInTimer setattribute self, $I0, $P0 @@ -348,8 +348,8 @@ This method returns the created palette. .local int color_id color_id = find_type "SDL::Color" - palette = new .ResizablePMCArray - hash = new .Hash + palette = new 'ResizablePMCArray' + hash = new 'Hash' set i, 0 GENLOOP: @@ -882,7 +882,7 @@ FORCE: .local pmc screen .local pmc color - rect = new .Hash + rect = new 'Hash' rect["width"] = 640 rect["height"] = 480 rect["x"] = 0 @@ -902,7 +902,7 @@ NO_MAINBACKGROUND: # update the screen # # XXX: optimize screen updates - rect = new .Hash + rect = new 'Hash' rect["width"] = 640 rect["height"] = 480 rect["x"] = 0 @@ -1062,7 +1062,7 @@ This method returns nothing. SET: # save the number of players - new temp, .Integer + new temp, 'Integer' set temp, players classoffset $I0, self, "Tetris::App" @@ -1075,7 +1075,7 @@ END_SET: print " player game...\n" # create the boards array - new temp, .ResizablePMCArray + new temp, 'ResizablePMCArray' classoffset $I0, self, "Tetris::App" add $I0, tBoards diff --git a/examples/sdl/tetris/block.pir b/examples/sdl/tetris/block.pir index 3c2810ff47..17aacea99a 100644 --- a/examples/sdl/tetris/block.pir +++ b/examples/sdl/tetris/block.pir @@ -41,7 +41,7 @@ is not subclassed further. addattribute $P0, "board" # set the BUILD method name - $P1 = new .String + $P1 = new 'String' $P1 = 'BUILD' setprop $P0, 'BUILD', $P1 END: @@ -71,35 +71,35 @@ The board the new block will belong to. .local int id classoffset id, self, "Tetris::Block" - + # # set some properties # # xpos - new prop, .Integer + new prop, 'Integer' set prop, 0 setattribute self, id, prop inc id - + # xposdiff - new prop, .Integer + new prop, 'Integer' set prop, 0 setattribute self, id, prop inc id - + # ypos - new prop, .Integer + new prop, 'Integer' set prop, 0 setattribute self, id, prop inc id # fall - new prop, .Integer + new prop, 'Integer' set prop, 0 setattribute self, id, prop inc id - + # set the board the block blongs to setattribute self, id, board @@ -133,7 +133,7 @@ Returns whether the block is falling down fast. add $I0, Fall getattribute $P0, self, $I0 $I0 = $P0 - + .return ($I0) .end @@ -150,7 +150,7 @@ Returns the x and y position of the block. .local pmc xposP .local pmc xposdiffP .local pmc yposP - + classoffset $I0, self, "Tetris::Block" add $I0, xPos getattribute xposP, self, $I0 @@ -163,7 +163,7 @@ Returns the x and y position of the block. add $I0, yPos getattribute yposP, self, $I0 sub $I0, yPos - + # calculate the ypos $I0 = self."vfree"() ypos = yposP @@ -204,10 +204,10 @@ Returns 1 if the rotation was possible, 0 otherwise. .local int i .local int j .local int ret - + size = self."size"() ret = self."validPosition"() - + unless ret goto END # rotate the block @@ -252,7 +252,7 @@ Returns the board associated with this block. classoffset $I0, self, "Tetris::Block" add $I0, Board getattribute $P0, self, $I0 - + .return ($P0) .end @@ -264,7 +264,7 @@ Set the board associated with this block. .sub setBoard :method .param pmc board - + # get the board classoffset $I0, self, "Tetris::Block" add $I0, Board @@ -331,11 +331,11 @@ xLOOP: add yp, y if yp < 0 goto ERROR if yp >= height goto ERROR - + i = board."offset"( xp, yp ) i = board[i] if i goto ERROR - + SKIP: inc x if x >= size goto yLOOP @@ -375,7 +375,7 @@ This method returns 1 on success, 0 otherwise. add $I0, yPos getattribute ypos, self, $I0 - + set xold, xpos set yold, ypos add xpos, xval @@ -437,11 +437,11 @@ This method returns nothing. .local pmc app .local pmc rect - rect = new .Hash - + rect = new 'Hash' + # get the application app = self."application"() - + # get the block's width/height size = self."size"() # get the block's id @@ -471,19 +471,19 @@ This method returns nothing. mul yp, extent add xp, xshift add yp, yshift - + i = app."flag"( "show blocksize" ) unless i goto NO_BLOCKSIZE set i, size mul i, extent - + rect["x"] = xp rect["y"] = yp rect["width"] = i rect["height"] = i find_type $I0, "SDL::Rect" temp = new $I0, rect - + surface."fill_rect"( temp, color ) sub i, 2 inc xp @@ -516,7 +516,7 @@ LOOPx: $I0 = self[i] if $I0 == 0 goto SKIP - + dec extent rect["x"] = xp rect["y"] = yp @@ -557,7 +557,7 @@ Returns 1 if the screen has to be redrawn. redraw = 0 app = self."application"() board = self."board"() - + fall = self."falling"() if fall goto FALL @@ -572,13 +572,13 @@ FALL: diff = board."fallInterval"() add curtime, diff board."setNextFallTime"( curtime ) - + # let the block fall down one unit self."moveDown"() - + # is it not falling fast? unless fall goto NOFALL - + # let the block fall down fast AGAIN: app."drawScreen"( 0 ) @@ -606,7 +606,7 @@ the C has been prepared. okay = self."move"( 0, +1 ) if okay goto BLOCK_MOVEDOWN_OKAY - + # get the board board = self."board"() # lock the block @@ -637,7 +637,7 @@ Returns the application object assosicated with the block's board. .sub setXPosition :method .param int pos - + getprop $P0, "xpos", self $P0 = pos .end diff --git a/examples/sdl/tetris/blockdata.pir b/examples/sdl/tetris/blockdata.pir index 7adf59379f..eceba01198 100644 --- a/examples/sdl/tetris/blockdata.pir +++ b/examples/sdl/tetris/blockdata.pir @@ -248,7 +248,7 @@ ERR: print ">=" print $I0 print ")!\n" - $P0 = new .Exception + $P0 = new 'Exception' $P0["_message"] = "out of bounds!" throw $P0 .end @@ -274,7 +274,7 @@ ERR: print ">=" print $I0 print ")!\n" - $P0 = new .Exception + $P0 = new 'Exception' $P0["_message"] = "out of bounds!" throw $P0 .end diff --git a/examples/sdl/tetris/blocks.pir b/examples/sdl/tetris/blocks.pir index e32264e910..2e97225eff 100644 --- a/examples/sdl/tetris/blocks.pir +++ b/examples/sdl/tetris/blocks.pir @@ -14,7 +14,7 @@ blocks.pir - tetris block classes getclass $P1, "Tetris::Block" - $P2 = new .String + $P2 = new 'String' $P2 = "__init" subclass $P0, $P1, "Tetris::Block::0" @@ -22,27 +22,27 @@ blocks.pir - tetris block classes subclass $P0, $P1, "Tetris::Block::1" setprop $P0, "BUILD", $P2 - + subclass $P0, $P1, "Tetris::Block::2" setprop $P0, "BUILD", $P2 - + subclass $P0, $P1, "Tetris::Block::3" setprop $P0, "BUILD", $P2 - + subclass $P0, $P1, "Tetris::Block::4" setprop $P0, "BUILD", $P2 - + subclass $P0, $P1, "Tetris::Block::5" setprop $P0, "BUILD", $P2 - + subclass $P0, $P1, "Tetris::Block::6" setprop $P0, "BUILD", $P2 - + .local pmc blocks .local pmc block - + blocks = new IntList - + find_type $I0, "Tetris::Block::0" push blocks, $I0 find_type $I0, "Tetris::Block::1" @@ -57,7 +57,7 @@ blocks.pir - tetris block classes push blocks, $I0 find_type $I0, "Tetris::Block::6" push blocks, $I0 - + store_global "Tetris::Block", "blocks", blocks END: .end @@ -113,7 +113,7 @@ END: # ... .sub __init :method .local pmc block - + block = new IntList push block, 1 push block, 1 @@ -138,7 +138,7 @@ END: # ... .sub __init :method .local pmc block - + block = new IntList push block, 1 push block, 1 @@ -163,7 +163,7 @@ END: # ... .sub __init :method .local pmc block - + block = new IntList push block, 0 push block, 1 @@ -188,7 +188,7 @@ END: # ... .sub __init :method .local pmc block - + block = new IntList push block, 1 push block, 1 @@ -214,7 +214,7 @@ END: # .... .sub __init :method .local pmc block - + block = new IntList push block, 1 push block, 1 diff --git a/examples/sdl/tetris/board.pir b/examples/sdl/tetris/board.pir index 6f15678cfd..9531a0e531 100644 --- a/examples/sdl/tetris/board.pir +++ b/examples/sdl/tetris/board.pir @@ -29,7 +29,7 @@ board.pir - a tetris board class. subclass $P0, $P0, "Tetris::Board" # set the BUILD method name - $P1 = new .String + $P1 = new 'String' $P1 = 'BUILD' setprop $P0, 'BUILD', $P1 END: @@ -93,27 +93,27 @@ Returns the created board. i = app."registerBoard"( self ) # set the 'next fall time' - new temp, .Float + new temp, 'Float' set temp, 0 setprop self, "NextFallTime", temp # set the 'fall interval' - new temp, .Float + new temp, 'Float' set temp, 0.5 setprop self, "FallInterval", temp # xpos - new temp, .Integer + new temp, 'Integer' set temp, 10 setprop self, "xpos", temp # ypos - new temp, .Integer + new temp, 'Integer' set temp, 10 setprop self, "ypos", temp # set the blocksize - new temp, .Integer + new temp, 'Integer' set temp, blocksize setprop self, "blocksize", temp @@ -608,7 +608,7 @@ This method returns nothing. .local int yp .local pmc rect - rect = new .Hash + rect = new 'Hash' # get the app's palette $P0 = self."application"() @@ -889,7 +889,7 @@ TDB $I0 = blocks # get a random block id - $P0 = new .Random + $P0 = new 'Random' $N0 = $P0 $N0 = $N0 * $I0 id = $N0 diff --git a/examples/sdl/tetris/boarddata.pir b/examples/sdl/tetris/boarddata.pir index c4cf34ced5..0208caed13 100644 --- a/examples/sdl/tetris/boarddata.pir +++ b/examples/sdl/tetris/boarddata.pir @@ -69,7 +69,7 @@ Returns the created data object. classoffset id, self, "Tetris::BoardData" # create the data array - new data, .ResizablePMCArray + new data, 'ResizablePMCArray' setattribute self, id, data # calculate the array size @@ -79,13 +79,13 @@ Returns the created data object. set data, i # store the width - new temp, .Integer + new temp, 'Integer' set temp, w inc id setattribute self, id, temp # store the height - new temp, .Integer + new temp, 'Integer' set temp, h inc id setattribute self, id, temp diff --git a/examples/sdl/tetris/eventhandler.pir b/examples/sdl/tetris/eventhandler.pir index 29ba01a84c..e654c903e8 100644 --- a/examples/sdl/tetris/eventhandler.pir +++ b/examples/sdl/tetris/eventhandler.pir @@ -13,7 +13,7 @@ eventhandler.pir - a tetris event handler class getclass $P0, "SDL::EventHandler" subclass $P0, $P0, "Tetris::EventHandler" - $P1 = new .String + $P1 = new 'String' $P1 = "BUILD" setprop $P0, "BUILD", $P1 addattribute $P0, "app" diff --git a/examples/shootout/ack.pir b/examples/shootout/ack.pir index 59a1df7a55..440883112b 100644 --- a/examples/shootout/ack.pir +++ b/examples/shootout/ack.pir @@ -30,7 +30,7 @@ go: $P0.'recursion_limit'(100000) r = ack(x, y) .local pmc args - args = new .ResizableIntegerArray + args = new 'ResizableIntegerArray' push args, x push args, y push args, r diff --git a/examples/shootout/binarytrees.pir b/examples/shootout/binarytrees.pir index 93722fd161..f1b88bcd14 100644 --- a/examples/shootout/binarytrees.pir +++ b/examples/shootout/binarytrees.pir @@ -41,7 +41,7 @@ else: null left null right endif: - tree = new .FixedPMCArray + tree = new 'FixedPMCArray' tree = 3 tree[0] = left tree[1] = right diff --git a/examples/shootout/fannkuch.pir b/examples/shootout/fannkuch.pir index a7df154e1b..eea01aa2c4 100644 --- a/examples/shootout/fannkuch.pir +++ b/examples/shootout/fannkuch.pir @@ -8,9 +8,9 @@ .sub fannkuch .param int n .local pmc perm, perm1, count - perm = new .FixedIntegerArray - perm1 = new .FixedIntegerArray - count = new .FixedIntegerArray + perm = new 'FixedIntegerArray' + perm1 = new 'FixedIntegerArray' + count = new 'FixedIntegerArray' .local int flips, flipsMax, r, i, k, didpr .local int n1 n1 = n diff --git a/examples/shootout/fasta.pir b/examples/shootout/fasta.pir index 261677054c..e4301fb47b 100644 --- a/examples/shootout/fasta.pir +++ b/examples/shootout/fasta.pir @@ -149,7 +149,7 @@ endfor: .end .macro InitStruct (iub, i, char, num) - $P0 = new .FixedPMCArray + $P0 = new 'FixedPMCArray' $P0 = 2 .iub[.i] = $P0 .iub[.i;0] = .char @@ -172,7 +172,7 @@ argsok: n = $S0 argsdone: .local pmc iub - iub = new .FixedPMCArray + iub = new 'FixedPMCArray' iub = 15 .InitStruct(iub, 0, "a", 0.27) .InitStruct(iub, 1, "c", 0.12) @@ -192,7 +192,7 @@ argsdone: .InitStruct(iub, 14, "Y", 0.02) .local pmc homosapiens - homosapiens = new .FixedPMCArray + homosapiens = new 'FixedPMCArray' homosapiens = 4 .InitStruct(homosapiens, 0, "a", 0.3029549426680) .InitStruct(homosapiens, 1, "c", 0.1979883004921) diff --git a/examples/shootout/harmonic.pir b/examples/shootout/harmonic.pir index 1587f0553b..37c6ae5106 100644 --- a/examples/shootout/harmonic.pir +++ b/examples/shootout/harmonic.pir @@ -38,7 +38,7 @@ NREDO: $N1 = 1 / i dec n if n goto NREDO - $P0 = new .FixedFloatArray + $P0 = new 'FixedFloatArray' $P0 = 1 $P0[0] = sum $S0 = sprintf "%.9f\n", $P0 diff --git a/examples/shootout/knucleotide.pir b/examples/shootout/knucleotide.pir index d04d17771b..338ab7b3cc 100644 --- a/examples/shootout/knucleotide.pir +++ b/examples/shootout/knucleotide.pir @@ -34,7 +34,7 @@ endwhile_2: .param int len .local int i, seqend .local pmc table - table = new .Hash + table = new 'Hash' i = 0 seqend = length seq beginfor: @@ -59,19 +59,19 @@ endfor: .local int i .local pmc array - array = new .FixedPMCArray + array = new 'FixedPMCArray' $I0 = elements table array = $I0 .local pmc iter - iter = new .Iterator, table + iter = new 'Iterator', table set iter, .ITERATE_FROM_START i = 0 iter_loop_1: unless iter goto iter_end_1 $S0 = shift iter $I0 = table[$S0] - $P0 = new .FixedPMCArray + $P0 = new 'FixedPMCArray' $P0 = 2 array[i] = $P0 array[i;0] = $S0 @@ -91,7 +91,7 @@ beginfor: $N0 = array[i;1] print $S0 print " " - $P0 = new .FixedFloatArray + $P0 = new 'FixedFloatArray' $P0 = 1 $N1 = seqlen $N0 /= $N1 diff --git a/examples/shootout/nbody.pir b/examples/shootout/nbody.pir index 82f6b3f7cd..c320d339a2 100644 --- a/examples/shootout/nbody.pir +++ b/examples/shootout/nbody.pir @@ -20,7 +20,7 @@ $N1 = .num5 * 365.24 $N2 = .num6 * 365.24 $N3 = .num7 * 39.478417604357428 - $P0 = new .FixedFloatArray + $P0 = new 'FixedFloatArray' $P0 = 7 .bodies[.i] = $P0 .bodies[.i; x] = .num1 @@ -42,7 +42,7 @@ n = $S0 argsok: .local pmc bodies - bodies = new .FixedPMCArray + bodies = new 'FixedPMCArray' bodies = 5 # Sun .InitBodies(bodies, 0, 0, 0, 0, 0, 0, 0, 1) @@ -87,7 +87,7 @@ argsok: offset_momentum(nbodies, bodies) $N0 = energy(nbodies, bodies) .local pmc spf - spf = new .FixedFloatArray + spf = new 'FixedFloatArray' spf = 1 spf[0] = $N0 $S0 = sprintf "%.9f\n", spf diff --git a/examples/shootout/nsieve-bits-2.pir b/examples/shootout/nsieve-bits-2.pir index b2d25989c5..166cadab0d 100644 --- a/examples/shootout/nsieve-bits-2.pir +++ b/examples/shootout/nsieve-bits-2.pir @@ -10,7 +10,7 @@ .param int M .local pmc flags .local int i, count - flags = new .FixedBooleanArray + flags = new 'FixedBooleanArray' flags = M i = 2 lp0: @@ -54,7 +54,7 @@ loop: $I1 = 1 << $I0 M = $I1 * 10000 count = primes_in_range(M) - $P0 = new .FixedIntegerArray + $P0 = new 'FixedIntegerArray' $P0 = 2 $P0[0] = M $P0[1] = count diff --git a/examples/shootout/nsieve-bits.pir b/examples/shootout/nsieve-bits.pir index b579435a94..0ba3cc889f 100644 --- a/examples/shootout/nsieve-bits.pir +++ b/examples/shootout/nsieve-bits.pir @@ -42,7 +42,7 @@ not_p: $S0 = argv[1] N = $S0 default: - flags = new .FixedBooleanArray + flags = new 'FixedBooleanArray' M = 1 << N M *= 10000 flags = M @@ -54,7 +54,7 @@ loop: $I1 = 1 << $I0 M = $I1 * 10000 count = primes_in_range(M, flags) - $P0 = new .FixedIntegerArray + $P0 = new 'FixedIntegerArray' $P0 = 2 $P0[0] = M $P0[1] = count diff --git a/examples/shootout/nsieve.pir b/examples/shootout/nsieve.pir index d535c09dc7..82f1eac4cf 100644 --- a/examples/shootout/nsieve.pir +++ b/examples/shootout/nsieve.pir @@ -35,7 +35,7 @@ not_p: .local pmc flags .local int argc, i, j, N, M, count - flags = new .FixedBooleanArray + flags = new 'FixedBooleanArray' N = 2 argc = argv if argc == 1 goto default @@ -53,7 +53,7 @@ loop: $I1 = 1 << $I0 M = $I1 * 10000 count = primes_in_range(M, flags) - $P0 = new .FixedIntegerArray + $P0 = new 'FixedIntegerArray' $P0 = 2 $P0[0] = M $P0[1] = count diff --git a/examples/shootout/partialsums-2.pir b/examples/shootout/partialsums-2.pir index f4b3f22510..c124ba1fc6 100644 --- a/examples/shootout/partialsums-2.pir +++ b/examples/shootout/partialsums-2.pir @@ -11,7 +11,7 @@ .local num sum1, sum2, sum3, sum4, sum5, sum6, sum7, sum8, sum9, a .local pmc parray .local string result - parray = new .FixedFloatArray + parray = new 'FixedFloatArray' parray = 9 $I0 = argv n = 25000 diff --git a/examples/shootout/partialsums.pir b/examples/shootout/partialsums.pir index 83e0a5ab09..d5b003f5b5 100644 --- a/examples/shootout/partialsums.pir +++ b/examples/shootout/partialsums.pir @@ -10,7 +10,7 @@ .local int k, n .local float sum, a .local pmc parray - parray = new .FixedFloatArray + parray = new 'FixedFloatArray' parray = 1 $I0 = argv n = 25000 diff --git a/examples/shootout/pidigits.pir b/examples/shootout/pidigits.pir index 5a069b3aa1..528d819ab3 100644 --- a/examples/shootout/pidigits.pir +++ b/examples/shootout/pidigits.pir @@ -30,7 +30,7 @@ loop: $P1 = k * 4 inc $P1 inc $P1 - $P2 = new .Integer + $P2 = new 'Integer' $P3 = k * 2 inc $P3 .yield ($P0, $P1, $P2, $P3) @@ -89,17 +89,17 @@ loop: .sub pi_digits .local pmc x0,x1,x2,x3, y, z0,z1,z2,z3, one, three, four - z0 = new .Integer + z0 = new 'Integer' z0 = 1 - z1 = new .Integer - z2 = new .Integer - z3 = new .Integer + z1 = new 'Integer' + z2 = new 'Integer' + z3 = new 'Integer' z3 = 1 - one = new .Integer + one = new 'Integer' one = 1 - three = new .Integer + three = new 'Integer' three = 3 - four = new .Integer + four = new 'Integer' four = 4 # while 1: # y = extract(z, 3) @@ -121,13 +121,13 @@ loop2: end_loop2: # z = compose((10, -10*y, 0, 1), z) # yield y - $P5 = new .Integer + $P5 = new 'Integer' $P5 = 10 - $P6 = new .Integer + $P6 = new 'Integer' $P6 = -10 $P6 = $P6 * y - $P7 = new .Integer - $P8 = new .Integer + $P7 = new 'Integer' + $P8 = new 'Integer' $P8 = 1 (z0, z1, z2, z3) = "compose"($P5, $P6, $P7, $P8, z0, z1, z2, z3) .yield (y) diff --git a/examples/shootout/random.pasm b/examples/shootout/random.pasm index fd9dac0d05..29491c8892 100644 --- a/examples/shootout/random.pasm +++ b/examples/shootout/random.pasm @@ -24,7 +24,7 @@ while_1: bsr gen_random dec I1 if I1, while_1 - new P0, .FixedFloatArray + new P0, 'FixedFloatArray' set P0, 1 set P0[0], N3 sprintf S0, "%.9f\n", P0 diff --git a/examples/shootout/random.pir b/examples/shootout/random.pir index 013ecfd719..df074ebd4d 100644 --- a/examples/shootout/random.pir +++ b/examples/shootout/random.pir @@ -12,7 +12,7 @@ while_1: dec $I0 if $I0 > 1 goto while_1 $N0 = gen_random(100.0) - $P0 = new .FixedFloatArray + $P0 = new 'FixedFloatArray' $P0 = 1 $P0[0] = $N0 $S0 = sprintf "%.9f\n", $P0 diff --git a/examples/shootout/recursive-2.pir b/examples/shootout/recursive-2.pir index a41b79b3b4..0d8d617afc 100644 --- a/examples/shootout/recursive-2.pir +++ b/examples/shootout/recursive-2.pir @@ -22,7 +22,7 @@ argsok: $P0.'recursion_limit'(100000) .local pmc array - array = new .FixedFloatArray + array = new 'FixedFloatArray' array = 11 dec n diff --git a/examples/shootout/recursive.pir b/examples/shootout/recursive.pir index 43c88ed94d..6f7dbf2e84 100644 --- a/examples/shootout/recursive.pir +++ b/examples/shootout/recursive.pir @@ -17,7 +17,7 @@ argsok: $P0.'recursion_limit'(100000) .local pmc array - array = new .FixedFloatArray + array = new 'FixedFloatArray' array = 11 dec n diff --git a/examples/shootout/regexdna.pir b/examples/shootout/regexdna.pir index bca5e6c2d9..056f35a9ef 100644 --- a/examples/shootout/regexdna.pir +++ b/examples/shootout/regexdna.pir @@ -6,7 +6,7 @@ p6rule_compile = compreg "PGE::P6Regex" # Store the regexes we need... - variants = new .FixedStringArray + variants = new 'FixedStringArray' variants = 9 variants[0] = ' agggtaaa|tttaccct ' variants[1] = '<[cgt]>gggtaaa|tttaccc<[acg]>' @@ -18,7 +18,7 @@ variants[7] = 'agggta<[cgt]>a|t<[acg]>taccct' variants[8] = 'agggtaa<[cgt]>|<[acg]>ttaccct' # and store the p5regex style for printing - variants_p5 = new .Hash + variants_p5 = new 'Hash' variants_p5[' agggtaaa|tttaccct '] = 'agggtaaa|tttaccct' variants_p5['<[cgt]>gggtaaa|tttaccc<[acg]>'] = '[cgt]gggtaaa|tttaccc[acg]' variants_p5['a<[act]>ggtaaa|tttacc<[agt]>t'] = 'a[act]ggtaaa|tttacc[agt]t' @@ -29,7 +29,7 @@ variants_p5['agggta<[cgt]>a|t<[acg]>taccct'] = 'agggta[cgt]a|t[acg]taccct' variants_p5['agggtaa<[cgt]>|<[acg]>ttaccct'] = 'agggtaa[cgt]|[acg]ttaccct' - iub = new .Hash + iub = new 'Hash' iub['b'] = '(c|g|t)' iub['d'] = '(a|g|t)' iub['h'] = '(a|c|t)' @@ -118,9 +118,9 @@ endfor: ##################################################### # Final replace to make the sequence a p5 style regex .include "iterator.pasm" - iter = new .Iterator, iub + iter = new 'Iterator', iub set iter, .ITERATE_FROM_START - matches = new .ResizablePMCArray + matches = new 'ResizablePMCArray' iter_loop: unless iter goto iter_end key = shift iter @@ -147,7 +147,7 @@ switch: $I0 = match."from"() $I1 = match."to"() $I1 -= $I0 - $P0 = new .FixedIntegerArray + $P0 = new 'FixedIntegerArray' $P0 = 2 $P0[0] = $I0 $P0[1] = $I1 diff --git a/examples/shootout/revcomp.pir b/examples/shootout/revcomp.pir index 2149b59cec..86ca11a98c 100644 --- a/examples/shootout/revcomp.pir +++ b/examples/shootout/revcomp.pir @@ -12,7 +12,7 @@ .sub tr_00_init :immediate .local pmc tr_array - tr_array = new .FixedIntegerArray # Todo char array + tr_array = new 'FixedIntegerArray' # Todo char array tr_array = 256 # Python compat ;) .local string from, to from = 'wsatugcyrkmbdhvnATUGCYRKMBDHVN' diff --git a/examples/shootout/spectralnorm.pir b/examples/shootout/spectralnorm.pir index 64e6a10c1b..040aaf385d 100644 --- a/examples/shootout/spectralnorm.pir +++ b/examples/shootout/spectralnorm.pir @@ -90,7 +90,7 @@ endfor_i: .param pmc AtAu .local pmc v - v = new .FixedFloatArray + v = new 'FixedFloatArray' v = N eval_A_times_u(N,u,v) @@ -109,9 +109,9 @@ endfor_i: N = $S0 default: .local pmc u, v - u = new .FixedFloatArray + u = new 'FixedFloatArray' u = N - v = new .FixedFloatArray + v = new 'FixedFloatArray' v = N .local int i @@ -157,7 +157,7 @@ endfor_calc: $N0 = vBv / vv $N0 = sqrt $N0 .local pmc spf - spf = new .FixedFloatArray + spf = new 'FixedFloatArray' spf = 1 spf[0] = $N0 $S0 = sprintf "%.9f\n", spf diff --git a/examples/shootout/takfp.pir b/examples/shootout/takfp.pir index 47dd224a52..6b9fbddf95 100644 --- a/examples/shootout/takfp.pir +++ b/examples/shootout/takfp.pir @@ -22,7 +22,7 @@ argsok: $N2 = n $N2 *= 1 f = Tak($N0, $N1, $N2) - $P0 = new .FixedFloatArray + $P0 = new 'FixedFloatArray' $P0 = 1 $P0[0] = f $S0 = sprintf "%.1f\n", $P0 diff --git a/examples/tge/branch/branch.g b/examples/tge/branch/branch.g index 44f23c9790..fa5ff244dc 100644 --- a/examples/tge/branch/branch.g +++ b/examples/tge/branch/branch.g @@ -25,7 +25,7 @@ # find the global minimum and propagate it back down the tree ROOT: gmin(.) = { .local pmc gmin - gmin = new .Integer + gmin = new 'Integer' gmin = tree.get('min', node) .return (gmin) } diff --git a/examples/tge/branch/transform.pir b/examples/tge/branch/transform.pir index 5e70b946bc..f935f87f3b 100644 --- a/examples/tge/branch/transform.pir +++ b/examples/tge/branch/transform.pir @@ -144,7 +144,7 @@ specified type. .param int value .local pmc newnode newnode = new 'Leaf' - $P1 = new .Integer + $P1 = new 'Integer' $P1 = value setattribute newnode, 'value', $P1 .return(newnode) diff --git a/src/dynpmc/ext.pir b/src/dynpmc/ext.pir index d04e751005..5b23d93caa 100644 --- a/src/dynpmc/ext.pir +++ b/src/dynpmc/ext.pir @@ -1,6 +1,6 @@ .pcc_sub _ext_main print "in ext.pir\n" - new P2, .Undef + new P2, 'Undef' print P2 .pcc_begin_return .pcc_end_return diff --git a/src/dynpmc/main.pasm b/src/dynpmc/main.pasm index 2c7349853e..ea883e0d8d 100644 --- a/src/dynpmc/main.pasm +++ b/src/dynpmc/main.pasm @@ -9,9 +9,9 @@ _main: loadlib P1, "subproxy" - new P3, .Key + new P3, 'Key' set P3, "src/dynpmc/ext.pir" # file - FIXME path handling - new P4, .Key + new P4, 'Key' set P4, "_ext_main" # sub label push P3, P4 find_type I0, "SubProxy" diff --git a/src/list.c b/src/list.c index 5e57baf657..49b602f0de 100644 --- a/src/list.c +++ b/src/list.c @@ -69,7 +69,7 @@ be created. To avoid this - and the performance penalty - set the array size before setting elements. - new P0, .Array + new P0, 'Array' set P0, 100000 # sets fixed sized, no sparse This is only meaningful, if a lot of the entries are used too. @@ -95,7 +95,7 @@ range. See C below for details. To save memory, List can handle sparse arrays. This code snippet: -new P0, .IntList +new P0, 'IntList' set P0[1000000], 42 generates 3 List_chunks, one at the beginning of the array, a diff --git a/src/ops/pmc.ops b/src/ops/pmc.ops index 4bf09855b7..8f0833590e 100644 --- a/src/ops/pmc.ops +++ b/src/ops/pmc.ops @@ -53,7 +53,7 @@ names in nested namespace, as well as by integer - you should do this for compatibility, to avoid problems if the base types get reassigned. For example: - new P0, .ResizableBooleanArray + new P0, 'ResizableBooleanArray' Optionally a PMC may be passed to the constructor. It's up to the class what to do with the intializer. See PDD02 for more. diff --git a/src/pmc/timer.pmc b/src/pmc/timer.pmc index b348d935da..612124d220 100644 --- a/src/pmc/timer.pmc +++ b/src/pmc/timer.pmc @@ -8,7 +8,7 @@ src/pmc/timer.pmc - Timer =head1 SYNOPSIS - new P0, .Timer + new P0, 'Timer' set P0[.PARROT_TIMER_SEC], I_seconds # whole seconds set P0[.PARROT_TIMER_USEC], I_micro seconds # and/or micro seconds set P0[.PARROT_TIMER_NSEC], N_seconds_frac # or fraction in seconds @@ -17,7 +17,7 @@ src/pmc/timer.pmc - Timer invoke P0 # start timer set P0[.PARROT_TIMER_RUNNING], 1 # same - new P0, .Timer, P1 # set everything + new P0, 'Timer', P1 # set everything set I0, P0[.PARROT_TIMER_SEC] # query current timer status set N0, P0[.PARROT_TIMER_NSEC] diff --git a/t/compilers/imcc/syn/clash.t b/t/compilers/imcc/syn/clash.t index d8bb3546de..0ed975c593 100644 --- a/t/compilers/imcc/syn/clash.t +++ b/t/compilers/imcc/syn/clash.t @@ -64,7 +64,7 @@ pir_output_is( <<'CODE', <<'OUT', "new" ); .sub test :main $P1 = new String $P1 = "ok 1\n" - new P1, .String + new P1, 'String' set P1, "ok 2\n" print $P1 print P1 @@ -80,7 +80,7 @@ pir_output_is( <<'CODE', <<'OUT', "clone" ); $P1 = new String $P1 = "ok 1\n" $P0 = clone $P1 - new P1, .String + new P1, 'String' set P1, "ok 2\n" clone P0, P1 print $P0 @@ -96,7 +96,7 @@ pir_output_is( <<'CODE', <<'OUT', "defined" ); .sub test :main $P1 = new Hash $I0 = defined $P1 - new P1, .Hash + new P1, 'Hash' defined I0, P1 print $I0 print "\n" @@ -114,7 +114,7 @@ pir_output_is( <<'CODE', <<'OUT', "defined keyed" ); $P1 = new Hash $P1["a"] = "ok 1\n" $I0 = defined $P1["a"] - new P1, .Hash + new P1, 'Hash' set P1["a"], "ok 2\n" defined I0, P1["a"] defined I1, P1["b"] diff --git a/t/compilers/imcc/syn/keyed.t b/t/compilers/imcc/syn/keyed.t index 6e99e7f3c1..b4577fca62 100644 --- a/t/compilers/imcc/syn/keyed.t +++ b/t/compilers/imcc/syn/keyed.t @@ -15,9 +15,9 @@ SKIP: { pir_output_is( <<'CODE', <<'OUTPUT', "add_keyed" ); .sub test :main - new P0, .Array - new P1, .Array - new P2, .Array + new P0, 'Array' + new P1, 'Array' + new P2, 'Array' P0 = 1 P1 = 2 P2 = 11 diff --git a/t/dynpmc/foo.t b/t/dynpmc/foo.t index db117cbcc4..d7898fe308 100644 --- a/t/dynpmc/foo.t +++ b/t/dynpmc/foo.t @@ -193,7 +193,7 @@ OUTPUT pir_output_is( << 'CODE', << 'OUTPUT', ".HLL 2" ); .HLL "Fool", "foo" .sub main :main - new $P1, .Foo # load by index + new $P1, 'Foo' # load by index $I1 = $P1 print $I1 print "\n" diff --git a/t/library/dumper.t b/t/library/dumper.t index 36fa470c66..1e15be0353 100644 --- a/t/library/dumper.t +++ b/t/library/dumper.t @@ -30,7 +30,7 @@ pir_output_is( <<'CODE', <<'OUT', "dumping array of sorted numbers" ); .sub test :main .local pmc array - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 0 push array, 1 push array, 2 @@ -66,7 +66,7 @@ pir_output_is( <<'CODE', <<'OUT', "dumping unsorted numbers" ); .sub test :main .local pmc array - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 6 push array, 1 push array, 8 @@ -102,7 +102,7 @@ pir_output_is( <<'CODE', <<'OUT', "dumping sorted strings" ); .sub test :main .local pmc array - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, "alpha" push array, "bravo" push array, "charlie" @@ -133,7 +133,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting unsorted strings" ); .sub test :main .local pmc array - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, "charlie" push array, "hotel" push array, "alpha" @@ -165,7 +165,7 @@ pir_output_is( <<'CODE', <<'OUT', "dumping different types" ); .sub test :main .local pmc array - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 0.1 push array, "charlie" push array, 2 @@ -225,11 +225,11 @@ pir_output_is( <<'CODE', <<'OUT', "dumping complex data" ); .local pmc array1 .local pmc array2 - new hash1, .Hash - new hash2, .Hash - new hash3, .Hash - new array1, .ResizablePMCArray - new array2, .ResizablePMCArray + new hash1, 'Hash' + new hash2, 'Hash' + new hash3, 'Hash' + new array1, 'ResizablePMCArray' + new array2, 'ResizablePMCArray' _dumper( hash1,"hash1" ) @@ -325,15 +325,15 @@ pir_output_is( <<'CODE', <<'OUT', "properties" ); .local pmc str .local pmc array - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, "test1" push array, "test2" - new str, .String + new str, 'String' set str, "value1" setprop array, "key1", str - new str, .String + new str, 'String' set str, "value2" setprop array, "key2", str @@ -362,10 +362,10 @@ pir_output_is( <<'CODE', <<'OUT', "indent string" ); .local string name .local string indent - new hash1, .Hash - new hash2, .Hash - new array1, .ResizablePMCArray - new array2, .ResizablePMCArray + new hash1, 'Hash' + new hash2, 'Hash' + new array1, 'ResizablePMCArray' + new array2, 'ResizablePMCArray' set hash1["hash2"], hash2 set hash2["array"], array1 @@ -425,7 +425,7 @@ pir_output_is( <<'CODE', <<'OUT', "back-referencing properties" ); .sub test :main .local pmc hash - new hash, .Hash + new hash, 'Hash' set hash["hello"], "world" setprop hash, "backref", hash @@ -447,7 +447,7 @@ pir_output_is( <<'CODE', <<'OUT', "self-referential properties (1)" ); .local pmc hash .local pmc prop - new hash, .Hash + new hash, 'Hash' set hash["hello"], "world" setprop hash, "self", hash @@ -473,9 +473,9 @@ pir_output_is( <<'CODE', <<'OUT', "self-referential properties (2)" ); .local pmc hash2 .local pmc prop - new array, .ResizablePMCArray - new hash1, .Hash - new hash2, .Hash + new array, 'ResizablePMCArray' + new hash1, 'Hash' + new hash2, 'Hash' set hash1["hello1"], "world1" set hash2["hello2"], "world2" @@ -518,7 +518,7 @@ pir_output_is( <<'CODE', <<'OUT', "dumping objects" ); newclass temp, "TestClass" find_type I0, "TestClass" - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' new temp, I0 push array, temp new temp, I0 @@ -578,7 +578,7 @@ pir_output_is( <<'CODE', <<'OUT', "dumping 'null'" ); .local pmc array .local pmc temp - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 0 @@ -587,11 +587,11 @@ pir_output_is( <<'CODE', <<'OUT', "dumping 'null'" ); null temp push array, temp - new temp, .Integer + new temp, 'Integer' set temp, 0 push array, temp - new temp, .String + new temp, 'String' set temp, "0" push array, temp @@ -649,10 +649,10 @@ pir_output_is( <<'CODE', <<'OUT', "dumping complex data in Hash" ); .local pmc hash3 .local pmc array1 - new hash1, .Hash - new hash2, .Hash - new hash3, .Hash - new array1, .ResizablePMCArray + new hash1, 'Hash' + new hash2, 'Hash' + new hash3, 'Hash' + new array1, 'ResizablePMCArray' _dumper( hash1,"hash1" ) @@ -748,7 +748,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping Integer PMC" ); .sub test :main .local pmc int1 - new int1, .Integer + new int1, 'Integer' int1 = 12345 _dumper( int1, "Int:" ) .end @@ -763,7 +763,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping Float PMC" ); .sub test :main .local pmc float1 - new float1, .Float + new float1, 'Float' float1 = 12345.678 _dumper( float1, "Float:" ) .end @@ -777,7 +777,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping ResizablePMCArray PMC" ); .sub test :main .local pmc array - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 12345 push array, "hello" _dumper( array, "array:" ) @@ -795,7 +795,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping ResizableStringArray PMC" ); .sub test :main .local pmc array - new array, .ResizableStringArray + new array, 'ResizableStringArray' push array, "hello" push array, "world" _dumper( array, "array:" ) @@ -813,7 +813,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping ResizableIntegerArray PMC" ); .sub test :main .local pmc array - new array, .ResizableIntegerArray + new array, 'ResizableIntegerArray' push array, 12345 push array, 67890 _dumper( array, "array:" ) @@ -831,7 +831,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping ResizableFloatArray PMC" ); .sub test :main .local pmc array - new array, .ResizableFloatArray + new array, 'ResizableFloatArray' push array, 123.45 push array, 67.89 _dumper( array, "array:" ) @@ -849,7 +849,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping FixedPMCArray PMC" ); .sub test :main .local pmc array - new array, .FixedPMCArray + new array, 'FixedPMCArray' array = 2 array[0] = 12345 array[1] = "hello" @@ -868,7 +868,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping FixedStringArray PMC" ); .sub test :main .local pmc array - new array, .FixedStringArray + new array, 'FixedStringArray' array = 2 array[0] = "hello" array[1] = "world" @@ -887,7 +887,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping FixedIntegerArray PMC" ); .sub test :main .local pmc array - new array, .FixedIntegerArray + new array, 'FixedIntegerArray' array = 2 array[0] = 12345 array[1] = 67890 @@ -906,7 +906,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "dumping FixedFloatArray PMC" ); .sub test :main .local pmc array - new array, .FixedFloatArray + new array, 'FixedFloatArray' array = 2 array[0] = 123.45 array[1] = 67.89 diff --git a/t/library/sort.t b/t/library/sort.t index 2ad3be710a..ce8b35c6cc 100644 --- a/t/library/sort.t +++ b/t/library/sort.t @@ -32,7 +32,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting already sorted numbers" ); .local pmc tmp .local pmc sort - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 0 push array, 1 push array, 2 @@ -78,7 +78,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting unsorted numbers" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 9 push array, 8 push array, 7 @@ -124,7 +124,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting unsorted numbers (2)" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 4 push array, 7 push array, 8 @@ -171,7 +171,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting sorted strings" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, "alpha" push array, "bravo" push array, "charlie" @@ -214,7 +214,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting unsorted strings" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, "charlie" push array, "hotel" push array, "alpha" @@ -257,7 +257,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting different types" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, 0.1 push array, "charlie" push array, 2 @@ -324,7 +324,7 @@ pir_output_is( <<'CODE', <<'OUT', "sorting letters" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray + new array, 'ResizablePMCArray' push array, "w" push array, "x" push array, "h" @@ -359,20 +359,20 @@ pir_output_is( <<'CODE', <<'OUT', "sorting String letters" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray - new tmp, .String + new array, 'ResizablePMCArray' + new tmp, 'String' set tmp, "w" push array, tmp - new tmp, .String + new tmp, 'String' set tmp, "x" push array, tmp - new tmp, .String + new tmp, 'String' set tmp, "h" push array, tmp - new tmp, .String + new tmp, 'String' set tmp, "y" push array, tmp @@ -405,8 +405,8 @@ pir_output_is( <<'CODE', <<'OUT', "sorting strings" ); .local int j .local pmc tmp, sort - new array, .ResizablePMCArray - new tmp, .String + new array, 'ResizablePMCArray' + new tmp, 'String' push array, "hello" push array, "hash2" push array, "hello2" diff --git a/t/pdd15oo/calling.t b/t/pdd15oo/calling.t index 98b4864eca..38790fcc57 100644 --- a/t/pdd15oo/calling.t +++ b/t/pdd15oo/calling.t @@ -1724,7 +1724,7 @@ OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "named - 2 flatten" ); .pcc_sub main: - new P0, .Hash + new P0, 'Hash' set P0['a'], 20 set P0['b'], 10 set_args "(0x220)", P0 # :flatten :named diff --git a/t/pdd15oo/mmd.t b/t/pdd15oo/mmd.t index 7e91f4ee5d..720966b22a 100644 --- a/t/pdd15oo/mmd.t +++ b/t/pdd15oo/mmd.t @@ -281,7 +281,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "PASM INTVAL - new result" ); find_global P10, "Integer_bxor_Intval" mmdvtregister .MMD_BXOR, .Integer, .DATATYPE_INTVAL, P10 - new P1, .Integer + new P1, 'Integer' set P1, 3 n_bxor P9, P1, 2 # create new result print P9 @@ -292,7 +292,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "PASM INTVAL - new result" ); print "ok\n" set I10, P5 bxor I11, I10, I5 - new P6, .Integer + new P6, 'Integer' set P6, I11 set_returns "(0)", P6 returncc @@ -308,8 +308,8 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "PASM INTVAL - existing result" ); find_global P10, "Integer_bxor_Intval" mmdvtregister .MMD_BXOR, .Integer, .DATATYPE_INTVAL, P10 - new P0, .Integer - new P1, .Integer + new P0, 'Integer' + new P1, 'Integer' set P1, 3 bxor P0, P1, 2 # use result print P0 @@ -335,8 +335,8 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "PASM INTVAL - mixed" ); find_global P10, "Integer_bxor_Intval" mmdvtregister .MMD_BXOR, .Integer, .DATATYPE_INTVAL, P10 - new P0, .Integer - new P1, .Integer + new P0, 'Integer' + new P1, 'Integer' set P1, 3 bxor P0, P1, 2 # reuse destination print P0 @@ -352,7 +352,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "PASM INTVAL - mixed" ); set I10, P5 bxor I11, I10, I5 if I7, has_dest - new P6, .Integer + new P6, 'Integer' has_dest: set P6, I11 set_returns "(0)", P6 diff --git a/t/pdd15oo/object-meths.t b/t/pdd15oo/object-meths.t index 748fb1a7c1..a0305d042d 100644 --- a/t/pdd15oo/object-meths.t +++ b/t/pdd15oo/object-meths.t @@ -144,7 +144,7 @@ OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "disabling the constructor" ); newpdd15class P1, "Foo" - new P0, .String + new P0, 'String' setprop P1, "BUILD", P0 new P3, "Foo" print "ok 1\n" diff --git a/t/pdd15oo/objects.t b/t/pdd15oo/objects.t index 0866817c92..b63202f9c7 100644 --- a/t/pdd15oo/objects.t +++ b/t/pdd15oo/objects.t @@ -1700,7 +1700,7 @@ ok 3 OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', "Wrong way to create new objects" ); - new P0, .ParrotObject + new P0, 'ParrotObject' end CODE /Can't create new ParrotObject/ diff --git a/t/pmc/addrregistry.t b/t/pmc/addrregistry.t index 76e14565df..c39a05e88b 100644 --- a/t/pmc/addrregistry.t +++ b/t/pmc/addrregistry.t @@ -30,7 +30,7 @@ Tests the AddrRegistry PMC. plan(1) - new P0, .AddrRegistry + new P0, 'AddrRegistry' ok(1, 'Instantiated .AddrRegistry') .end diff --git a/t/pmc/array.t b/t/pmc/array.t index 2761bf00fc..ef14715239 100644 --- a/t/pmc/array.t +++ b/t/pmc/array.t @@ -67,7 +67,7 @@ my $fp_equality_macro = <<'ENDOFMACRO'; ENDOFMACRO pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" ); - new P0,.Array + new P0, 'Array' set I0,P0 eq I0,0,OK_1 @@ -86,8 +86,8 @@ OK_2: print "ok 2\n" print "not " OK_3: print "ok 3\n" - new P1, .Integer - set P1, 3 + new P1, 'Integer' + set P1, 3 set P0,P1 set I0,P0 eq I0,3,OK_4 @@ -104,8 +104,8 @@ ok 4 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" ); - new P0, .Array - set P0, 1 + new P0, 'Array' + set P0, 1 set P0[0],-7 set I0,P0[0] @@ -133,8 +133,8 @@ ok 3 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" ); - new P0, .Array - set P0, 2 + new P0, 'Array' + set P0, 2 set P0[1], -7 set I0, P0[1] @@ -162,8 +162,8 @@ ok 3 OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" ); - new P0, .Array - set P0, 1 + new P0, 'Array' + set P0, 1 set P0[1], -7 @@ -174,8 +174,8 @@ current instr/ OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" ); - new P0, .Array - set P0, 1 + new P0, 'Array' + set P0, 1 set I0, P0[1] end @@ -185,7 +185,7 @@ current instr/ OUTPUT pasm_output_is( <<'CODE', < PMC. =cut pasm_output_is( <<'CODE', <. =cut pasm_output_is( <<'CODE', <<'OUTPUT', "creation" ); - new P0, .IntList + new P0, 'IntList' set I0, P0 print "Created IntList with " print I0 @@ -37,7 +37,7 @@ OUTPUT # This test just runs way too slowly with GC_DEBUG turned on, so lets # turn it off for make test runs. pasm_output_is( <<'CODE', <<'OUTPUT', "aerobics" ); - new P0, .IntList + new P0, 'IntList' set I10, 10000 set I1, 0 @@ -169,7 +169,7 @@ I need a shower. OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "direct access 2" ); - new P0, .IntList + new P0, 'IntList' set I10, 1100000 set I0, 1 lp1: @@ -223,7 +223,7 @@ ok OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "sparse access" ); - new P0, .IntList + new P0, 'IntList' set I10, 110000 set I0, 1 lp1: @@ -292,7 +292,7 @@ ok 2 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "pop into sparse" ); - new P0, .IntList + new P0, 'IntList' set I10, 100 set I0, 0 # push some values at start @@ -357,7 +357,7 @@ ok OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "clone" ); - new P0, .IntList + new P0, 'IntList' set P0[0], 100 set P0[5000], 200 clone P1, P0 @@ -394,8 +394,8 @@ ok OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "access via a PMC key" ); - new P0, .IntList - new P1, .Key + new P0, 'IntList' + new P1, 'Key' set I0, 0 L1: set P1, I0 @@ -413,8 +413,8 @@ L2: set I3, P0[I2] print "ok 1\n" GET: - new P2, .IntList - new P3, .Key + new P2, 'IntList' + new P3, 'Key' set I0, 0 L3: set P2[I0], I0 diff --git a/t/pmc/io.t b/t/pmc/io.t index 912688f34b..9d7e79fe0f 100644 --- a/t/pmc/io.t +++ b/t/pmc/io.t @@ -39,11 +39,11 @@ TODO: { .sub main $P0 = null test($P0, "Undef") - new $P0, .Integer + new $P0, 'Integer' test($P0, "null") - new $P0, .Undef + new $P0, 'Undef' test($P0, "Integer") - new $P0, .String + new $P0, 'String' test($P0, "String") .end .sub test @@ -269,7 +269,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "open & print" ); set I0, -12 set N0, 2.2 set S0, "Foo" - new P0, .String + new P0, 'String' set P0, "Bar\n" open P1, "temp.file" @@ -477,7 +477,7 @@ ok 3 OUT pasm_output_is( <<'CODE', <<'OUTPUT', 'printerr' ); - new P0, .String + new P0, 'String' set P0, "This is a test\n" printerr 10 printerr "\n" diff --git a/t/pmc/key.t b/t/pmc/key.t index fdd3ccf0c6..4846b2ade0 100644 --- a/t/pmc/key.t +++ b/t/pmc/key.t @@ -23,12 +23,12 @@ Tests the C PMC. =cut pasm_output_is( <<'CODE', <<'OUT', 'traverse key chain' ); - new P0, .Key + new P0, 'Key' set P0, "1" - new P1, .Key + new P1, 'Key' set P1, "2" push P0, P1 - new P2, .Key + new P2, 'Key' set P2, "3" push P1, P2 @@ -58,7 +58,7 @@ CODE OUT pasm_output_is( <<'CODE', <<'OUT', 'extract int from string keys' ); -new P0, .ResizableStringArray +new P0, 'ResizableStringArray' push P0, "ok 1\n" push P0, "ok 2\n" set S0, 0 @@ -73,7 +73,7 @@ ok 2 OUT pasm_output_is( <<'CODE', <<'OUT', 'extract string from int keys' ); -new P0, .Hash +new P0, 'Hash' set P0['1'], "ok 1\n" set P0['2'], "ok 2\n" set I0, 1 diff --git a/t/pmc/lexpad.t b/t/pmc/lexpad.t index 936535e566..f16725e743 100644 --- a/t/pmc/lexpad.t +++ b/t/pmc/lexpad.t @@ -25,7 +25,7 @@ Tests the LexPad PMC. pir_error_output_like( <<'CODE', <<'OUT', 'new' ); .sub 'test' :main - new P0, .LexPad + new P0, 'LexPad' print "ok 1\n" .end CODE diff --git a/t/pmc/managedstruct.t b/t/pmc/managedstruct.t index bb26fd05b0..bae69e394d 100644 --- a/t/pmc/managedstruct.t +++ b/t/pmc/managedstruct.t @@ -24,7 +24,7 @@ Tests the ManagedStruct PMC. Checks element access and memory allocation. =cut pasm_output_is( <<'CODE', <<'OUTPUT', "Setting ManagedStruct size" ); - new P0,.ManagedStruct + new P0, 'ManagedStruct' set I0,P0 eq I0,0,OK_1 print "not " @@ -47,7 +47,7 @@ ok 3 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "element access - float, double" ); - new P2, .ResizablePMCArray + new P2, 'ResizablePMCArray' .include "datatypes.pasm" push P2, .DATATYPE_FLOAT push P2, 2 # 2 elem array @@ -55,7 +55,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "element access - float, double" ); push P2, .DATATYPE_DOUBLE push P2, 0 push P2, 0 - new P0, .ManagedStruct, P2 + new P0, 'ManagedStruct', P2 # must have set size automatically # this is hopefully 2*4+8 everywhere set I0, P0 @@ -83,12 +83,12 @@ CODE OUTPUT pasm_output_like( <<'CODE', <<'OUTPUT', "element access - char, short" ); - new P2, .ResizablePMCArray + new P2, 'ResizablePMCArray' .include "datatypes.pasm" push P2, .DATATYPE_CHAR push P2, 2 # 2 elem char array push P2, 0 - new P0, .ManagedStruct, P2 + new P0, 'ManagedStruct', P2 set I0, P0 ge I0, 2, ok1 print "not " @@ -102,7 +102,7 @@ ok1: print I0 print " " # now acces that as a short - new P2, .ResizablePMCArray + new P2, 'ResizablePMCArray' push P2, .DATATYPE_SHORT push P2, 1 push P2, 0 @@ -120,7 +120,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "named element access int16" ); .include "datatypes.pasm" .sub _main - new $P1, .OrderedHash + new $P1, 'OrderedHash' set $P1['x'], .DATATYPE_INT16 push $P1, 0 push $P1, 0 @@ -130,7 +130,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "named element access int16" ); push $P1, 0 # need a ManagedStruct to allocate data memory - new $P2, .ManagedStruct, $P1 + new $P2, 'ManagedStruct', $P1 # calc allocation size set $I0, 0 @@ -180,16 +180,16 @@ OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "nested struct offsets" ); # the nested structure .include "datatypes.pasm" - new P3, .ResizablePMCArray + new P3, 'ResizablePMCArray' push P3, .DATATYPE_INT push P3, 0 push P3, 0 push P3, .DATATYPE_INT push P3, 0 push P3, 0 - new P4, .UnManagedStruct, P3 + new P4, 'UnManagedStruct', P3 # outer structure - new P2, .ResizablePMCArray + new P2, 'ResizablePMCArray' push P2, .DATATYPE_INT push P2, 0 push P2, 0 @@ -203,7 +203,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "nested struct offsets" ); push P2, 0 push P2, 0 # attach struct initializer - new P5, .UnManagedStruct, P2 + new P5, 'UnManagedStruct', P2 # now check offsets set I0, P2[2] diff --git a/t/pmc/multiarray.t b/t/pmc/multiarray.t index 9b0367160b..a722e31bf0 100644 --- a/t/pmc/multiarray.t +++ b/t/pmc/multiarray.t @@ -24,20 +24,20 @@ and cloning. =cut pasm_output_is( <<'CODE', <<'OUTPUT', "multiarray creation" ); - new P1, .ResizablePMCArray + new P1, 'ResizablePMCArray' # intial size set P1[0], 0 set P1[1], 50 # dimensions 10x5 2D array # XXX can this be done w/o push/append a key? - new P2, .Key + new P2, 'Key' set P2, 10 - new P3, .Key + new P3, 'Key' set P3, 5 push P2, P3 set P1[2], 1 set P1[3], P2 - new P0, .MultiArray, P1 + new P0, 'MultiArray', P1 print "ok\n" end CODE @@ -45,19 +45,19 @@ ok OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "multiarray access 2d" ); - new P1, .ResizablePMCArray + new P1, 'ResizablePMCArray' # intial size set P1[0], 0 set P1[1], 100 # dimensions - new P2, .Key + new P2, 'Key' set P2, 10 - new P3, .Key + new P3, 'Key' set P3, 5 push P2, P3 set P1[2], 1 set P1[3], P2 - new P0, .MultiArray, P1 + new P0, 'MultiArray', P1 # array size, multiarray doesnt autogrow set P0, 200 @@ -102,22 +102,22 @@ ok 2 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "multiarray access 3d" ); - new P1, .ResizablePMCArray + new P1, 'ResizablePMCArray' # initial size set P1[0], 0 set P1[1], 200 # dimensions 10x5x4 - new P2, .Key + new P2, 'Key' set P2, 10 - new P3, .Key + new P3, 'Key' set P3, 5 push P2, P3 - new P3, .Key + new P3, 'Key' set P3, 4 push P2, P3 set P1[2], 1 set P1[3], P2 - new P0, .MultiArray, P1 + new P0, 'MultiArray', P1 set P0, 200 set I10, 10 diff --git a/t/pmc/null.t b/t/pmc/null.t index ef1106b0e3..a4b9d95029 100644 --- a/t/pmc/null.t +++ b/t/pmc/null.t @@ -21,7 +21,7 @@ Tests the Null PMC. plan(1) - new P0, .Null + new P0, 'Null' ok(1, 'Instantiated .Null') .end diff --git a/t/pmc/object.t b/t/pmc/object.t index 32882099db..53c7d679e0 100644 --- a/t/pmc/object.t +++ b/t/pmc/object.t @@ -35,7 +35,7 @@ Tests the Object PMC. plan(1) push_eh cant_instantiate - new P0, .Object + new P0, 'Object' clear_eh ok(0, 'Able to instantiate .Object') goto done_1 diff --git a/t/pmc/orderedhash.t b/t/pmc/orderedhash.t index 98ae4dfcba..a3a1b63bbd 100644 --- a/t/pmc/orderedhash.t +++ b/t/pmc/orderedhash.t @@ -23,7 +23,7 @@ Tests the C PMC. =cut pasm_output_is( <<'CODE', < PMC. =cut pasm_output_is( <<'CODE', <<'OUTPUT', "new ref" ); - new P2, .Integer - new P1, .Ref, P2 + new P2, 'Integer' + new P1, 'Ref', P2 print "ok 1\n" end CODE @@ -32,8 +32,8 @@ ok 1 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "inc ref" ); - new P2, .Integer - new P1, .Ref, P2 + new P2, 'Integer' + new P1, 'Ref', P2 inc P1 print P1 print P2 @@ -44,9 +44,9 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "dec ref" ); - new P2, .Integer - set P2, 2 - new P1, .Ref, P2 + new P2, 'Integer' + set P2, 2 + new P1, 'Ref', P2 dec P1 print P1 print P2 @@ -57,8 +57,8 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "deref" ); - new P2, .Integer - new P1, .Ref, P2 + new P2, 'Integer' + new P1, 'Ref', P2 print "ok 1\n" deref P3, P1 typeof S0, P1 @@ -75,10 +75,10 @@ Integer OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "setref ref" ); - new P2, .Integer - new P3, .Float + new P2, 'Integer' + new P3, 'Float' set P3, 0.5 - new P1, .Ref, P2 + new P1, 'Ref', P2 inc P1 print P1 print "\n" @@ -101,11 +101,11 @@ OUTPUT TODO: { local $TODO = 'pending new Ref semantic'; pasm_output_is( <<'CODE', <<'OUTPUT', "assign ref" ); - new P2, .Integer - new P3, .Float - set P2, 0 + new P2, 'Integer' + new P3, 'Float' + set P2, 0 set P3, 0.5 - new P1, .Ref, P2 + new P1, 'Ref', P2 assign P1, 1 print P1 print "\n" @@ -126,8 +126,8 @@ OUTPUT } pasm_output_is( <<'CODE', <<'OUTPUT', "typeof SharedRef" ); - new P2, .Integer - new P1, .SharedRef, P2 + new P2, 'Integer' + new P1, 'SharedRef', P2 print "ok 1\n" set P1, 4711 print P1 @@ -150,8 +150,8 @@ hello OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', "deref SharedRef" ); - new P2, .Integer - new P1, .SharedRef, P2 + new P2, 'Integer' + new P1, 'SharedRef', P2 print "ok 1\n" deref P3, P1 print "never\n" @@ -201,14 +201,14 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "set/get int" ); - new P2, .Integer - new P1, .Ref, P2 - set P1, 10 - print P2 - print "\n" - set I0, P1 - print I0 - print "\n" + new P2, 'Integer' + new P1, 'Ref', P2 + set P1, 10 + print P2 + print "\n" + set I0, P1 + print I0 + print "\n" end CODE 10 @@ -216,8 +216,8 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "set/get float" ); - new P2, .Float - new P1, .Ref, P2 + new P2, 'Float' + new P1, 'Ref', P2 set P1, 12.5 set N0, P2 set N1, 12.5 @@ -235,8 +235,8 @@ ok 2 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "push/pop" ); - new P2, .ResizableIntegerArray - new P1, .Ref, P2 + new P2, 'ResizableIntegerArray' + new P1, 'Ref', P2 push P1, 200 push P1, -3 set I0, P1 @@ -264,8 +264,8 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "add ref, ref, ref" ); - new P2, .Integer - new P1, .Ref, P2 + new P2, 'Integer' + new P1, 'Ref', P2 set P1, 10 add P1, P1, P1 print P2 @@ -276,9 +276,9 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "add ref, ref, int" ); - new P3, .Integer - new P2, .Integer - new P1, .Ref, P2 + new P3, 'Integer' + new P2, 'Integer' + new P1, 'Ref', P2 set P3, 12 set P1, 10 add P1, P1, P3 @@ -290,9 +290,9 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "add ref, int, ref" ); - new P3, .Integer - new P2, .Integer - new P1, .Ref, P2 + new P3, 'Integer' + new P2, 'Integer' + new P1, 'Ref', P2 set P3, 12 set P1, 10 add P1, P3, P1 @@ -304,9 +304,9 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "add ref, int, int" ); - new P3, .Integer - new P2, .Integer - new P1, .Ref, P2 + new P3, 'Integer' + new P2, 'Integer' + new P1, 'Ref', P2 set P3, 12 set P1, 10 add P1, P3, P3 diff --git a/t/pmc/resizablebooleanarray.t b/t/pmc/resizablebooleanarray.t index 784aff282a..cea1c46e18 100644 --- a/t/pmc/resizablebooleanarray.t +++ b/t/pmc/resizablebooleanarray.t @@ -657,7 +657,7 @@ I need a shower. OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "direct access 2" ); - #new P0, .IntList + #new P0, 'IntList' new P0, 'ResizableBooleanArray' set I10, 550000 set I0, 1 diff --git a/t/pmc/resizablefloatarray.t b/t/pmc/resizablefloatarray.t index 5e894ea475..d4de439914 100644 --- a/t/pmc/resizablefloatarray.t +++ b/t/pmc/resizablefloatarray.t @@ -67,7 +67,7 @@ my $fp_equality_macro = <<'ENDOFMACRO'; ENDOFMACRO pasm_output_is( <<'CODE', <<'OUTPUT', 'creation' ); - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' print "ok\n" end CODE @@ -75,7 +75,7 @@ ok OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" ); - new P0,.ResizableFloatArray + new P0, 'ResizableFloatArray' set I0,P0 eq I0,0,OK_1 @@ -116,7 +116,7 @@ ok 5 OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting negative array size" ); - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' set P0, -100 end CODE @@ -124,8 +124,8 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" ); - new P0, .ResizableFloatArray - set P0, 1 + new P0, 'ResizableFloatArray' + set P0, 1 set P0[0],-7 set I0,P0[0] @@ -153,7 +153,7 @@ ok 3 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" ); - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' set P0[1], -7 set I0, P0[1] @@ -183,8 +183,8 @@ OUTPUT # TODO: Rewrite these properly when we have exceptions pasm_output_is( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" ); - new P0, .ResizableFloatArray - set P0, 1 + new P0, 'ResizableFloatArray' + set P0, 1 set P0[1], -7 print "ok 1\n" @@ -195,8 +195,8 @@ ok 1 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" ); - new P0, .ResizableFloatArray - set P0, 1 + new P0, 'ResizableFloatArray' + set P0, 1 set I0, P0[1] print "ok 1\n" @@ -207,8 +207,8 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" ); @{[ $fp_equality_macro ]} - new P0, .ResizableFloatArray - new P1, .Key + new P0, 'ResizableFloatArray' + new P1, 'Key' set P1, 0 set P0[P1], 25 @@ -243,17 +243,17 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" ); @{[ $fp_equality_macro ]} - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' set P0, 1 set P0[25], 125 set P0[128], 10.2 set P0[513], "17.3" - new P1, .Integer + new P1, 'Integer' set P1, 123456 set P0[1023], P1 - new P2, .Key + new P2, 'Key' set P2, 25 set I0, P0[P2] eq I0, 125, OK1 @@ -289,7 +289,7 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', 'basic push' ); @{[ $fp_equality_macro ]} - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' push P0, 1.0 push P0, 2.0 push P0, 3.0 @@ -316,7 +316,7 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', 'push many values' ); @{[ $fp_equality_macro ]} - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' set I0, 0 L1: set N0, I0 push P0, N0 @@ -335,7 +335,7 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', 'basic pop' ); @{[ $fp_equality_macro ]} - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' set P0[0], 1.0 set P0[1], 2.0 set P0[2], 3.0 @@ -362,7 +362,7 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', 'pop many values' ); @{[ $fp_equality_macro ]} - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' set I0, 0 L1: set N0, I0 set P0[I0], N0 @@ -390,7 +390,7 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', 'push/pop' ); @{[ $fp_equality_macro ]} - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' push P0, 1.0 push P0, 2.0 push P0, 3.0 @@ -404,7 +404,7 @@ ok 1 OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', 'pop from empty array' ); - new P0, .ResizableFloatArray + new P0, 'ResizableFloatArray' pop N0, P0 end CODE diff --git a/t/pmc/resizableintegerarray.t b/t/pmc/resizableintegerarray.t index 862fda4213..737a73b2ae 100644 --- a/t/pmc/resizableintegerarray.t +++ b/t/pmc/resizableintegerarray.t @@ -67,7 +67,7 @@ my $fp_equality_macro = <<'ENDOFMACRO'; ENDOFMACRO pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" ); - new P0, .ResizableIntegerArray + new P0, 'ResizableIntegerArray' set I0,P0 eq I0,0,OK_1 @@ -108,8 +108,8 @@ ok 5 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" ); - new P0, .ResizableIntegerArray - set P0, 1 + new P0, 'ResizableIntegerArray' + set P0, 1 set P0[0],-7 set I0,P0[0] @@ -137,7 +137,7 @@ ok 3 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" ); - new P0, .ResizableIntegerArray + new P0, 'ResizableIntegerArray' set P0[1], -7 set I0, P0[1] @@ -167,8 +167,8 @@ OUTPUT # TODO: Rewrite these properly when we have exceptions pasm_output_is( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" ); - new P0, .ResizableIntegerArray - set P0, 1 + new P0, 'ResizableIntegerArray' + set P0, 1 set P0[1], -7 print "ok 1\n" @@ -179,8 +179,8 @@ ok 1 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" ); - new P0, .ResizableIntegerArray - set P0, 1 + new P0, 'ResizableIntegerArray' + set P0, 1 set I0, P0[1] print "ok 1\n" @@ -191,8 +191,8 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" ); @{[ $fp_equality_macro ]} - new P0, .ResizableIntegerArray - new P1, .Key + new P0, 'ResizableIntegerArray' + new P1, 'Key' set P1, 0 set P0[P1], 25 @@ -227,17 +227,17 @@ OUTPUT pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" ); @{[ $fp_equality_macro ]} - new P0, .ResizableIntegerArray + new P0, 'ResizableIntegerArray' set P0, 1 set P0[25], 125 set P0[128], 10.2 set P0[513], "17" - new P1, .Integer + new P1, 'Integer' set P1, 123456 set P0[1023], P1 - new P2, .Key + new P2, 'Key' set P2, 25 set I0, P0[P2] eq I0, 125, OK1 @@ -317,7 +317,7 @@ CODE OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', 'basic pop' ); - new P0, .ResizableIntegerArray + new P0, 'ResizableIntegerArray' set P0[0], 4 set P0[1], 8 set P0[2], 16 @@ -346,7 +346,7 @@ ok 3 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', 'pop many values' ); - new P0, .ResizableIntegerArray + new P0, 'ResizableIntegerArray' set I0, 0 L1: set P0[I0], I0 inc I0 @@ -371,7 +371,7 @@ ok OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', 'push/pop' ); - new P0, .ResizableIntegerArray + new P0, 'ResizableIntegerArray' push P0, 2 push P0, 4 push P0, 6 @@ -385,7 +385,7 @@ ok 1 OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', 'pop from empty array' ); - new P0, .ResizableIntegerArray + new P0, 'ResizableIntegerArray' pop I0, P0 end CODE diff --git a/t/pmc/retcontinuation.t b/t/pmc/retcontinuation.t index 76cb0e28e4..ab3e134b66 100644 --- a/t/pmc/retcontinuation.t +++ b/t/pmc/retcontinuation.t @@ -30,7 +30,7 @@ Tests the RetContinuation PMC. plan(1) - new P0, .RetContinuation + new P0, 'RetContinuation' ok(1, 'Instantiated .RetContinuation') .end diff --git a/t/pmc/sarray.t b/t/pmc/sarray.t index 5057d2d6be..56766fc70b 100644 --- a/t/pmc/sarray.t +++ b/t/pmc/sarray.t @@ -66,7 +66,7 @@ my $fp_equality_macro = <<'ENDOFMACRO'; ENDOFMACRO pasm_output_is( <<'CODE', <<'OUTPUT', "Setting sarray size" ); - new P0, .SArray + new P0, 'SArray' set I0, P0 eq I0, 0, OK_1 print "not " @@ -85,7 +85,7 @@ ok 2 OUTPUT pasm_error_output_like( <<'CODE', <<'OUTPUT', "attempt resize" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[0], 100 set I0, P0 @@ -104,7 +104,7 @@ OUTPUT # ' pasm_output_is( <<'CODE', <<'OUTPUT', "indexed access" ); - new P0, .SArray + new P0, 'SArray' set P0, 3 set P0[0], 100 set P0[1], 200 @@ -144,7 +144,7 @@ ok 6 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "push" ); - new P0, .SArray + new P0, 'SArray' set P0, 3 push P0, 100 push P0, 200 @@ -184,7 +184,7 @@ ok 6 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "push / indexed" ); - new P0, .SArray + new P0, 'SArray' set P0, 3 push P0, 100 set P0[1], 200 @@ -224,14 +224,14 @@ ok 6 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "mixed indexed" ); - new P0, .SArray + new P0, 'SArray' set P0, 4 set P0[0], 1000 set N0, 222.22 set P0[1], N0 set S0, "string\n" set P0[2], S0 - new P1, .Undef + new P1, 'Undef' set P1, 42 set P0[3], P1 @@ -257,14 +257,14 @@ string OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "mixed push" ); - new P0, .SArray + new P0, 'SArray' set P0, 4 push P0, 1000 set N0, 222.22 push P0, N0 set S0, "string\n" push P0, S0 - new P1, .Undef + new P1, 'Undef' set P1, 42 push P0, P1 @@ -290,14 +290,14 @@ string OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "mixed push - clone" ); - new P2, .SArray + new P2, 'SArray' set P2, 4 push P2, 1000 set N0, 222.22 push P2, N0 set S0, "string\n" push P2, S0 - new P1, .Undef + new P1, 'Undef' set P1, 42 push P2, P1 @@ -325,7 +325,7 @@ string OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "shift_integer" ); - new P0, .SArray + new P0, 'SArray' set P0, 3 set P0[0], 100 set P0[1], 200 @@ -365,14 +365,14 @@ ok 6 OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "mixed shift" ); - new P0, .SArray + new P0, 'SArray' set P0, 4 push P0, 1000 set N0, 222.22 push P0, N0 set S0, "string\n" push P0, S0 - new P1, .Undef + new P1, 'Undef' set P1, 42 push P0, P1 @@ -399,25 +399,25 @@ OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "iterator" ); .include "iterator.pasm" - new P0, .SArray # empty array - new P2, .SArray # array with 2 elements + new P0, 'SArray' # empty array + new P2, 'SArray' # array with 2 elements set P2, 2 push P2, 10 push P2, 20 set I0, P2 - new P1, .Iterator, P2 + new P1, 'Iterator', P2 print "ok 1\n" set I1, P1 eq I0, I1, ok2 # iter.length() == array.length() print "not " ok2: print "ok 2\n" - new P1, .Iterator, P0 + new P1, 'Iterator', P0 set P1, .ITERATE_FROM_START print "ok 3\n" unless P1, ok4 # if(iter) == false on empty print "not " ok4: print "ok 4\n" - new P1, .Iterator, P2 + new P1, 'Iterator', P2 set P1, .ITERATE_FROM_START if P1, ok5 # if(iter) == true on non empty print "not " @@ -499,36 +499,36 @@ OUTPUT pasm_output_is( << "CODE", << 'OUTPUT', "Access via Key PMC" ); @{[ $fp_equality_macro ]} - new P0, .SArray + new P0, 'SArray' set P0, 4 set P0[0], 100 set P0[1], 12.298 set P0[2], "yarrAS" - new P31, .Hash - set P31["Test"], "ok" - set P0[3], P31 - new P1, .Key - set P1, 0 + new P31, 'Hash' + set P31["Test"], "ok" + set P0[3], P31 + new P1, 'Key' + set P1, 0 set I0, P0[P1] eq I0, 100, ok1 print "not " ok1: print "ok 1\\n" - new P2, .Key - set P2, 1 + new P2, 'Key' + set P2, 1 set N0, P0[P2] .fp_eq(N0, 12.298, ok2) print "not " ok2: print "ok 2\\n" - new P3, .Key - set P3, 2 + new P3, 'Key' + set P3, 2 set S0, P0[P3] eq S0, "yarrAS", ok3 print "not " ok3: print "ok 3\\n" - new P4, .Key - set P4, 3 + new P4, 'Key' + set P4, 3 set P5, P0[P4] - set S1, P5["Test"] + set S1, P5["Test"] eq S1, "ok", ok4 print "not " ok4: print "ok 4\\n" @@ -541,12 +541,12 @@ ok 4 OUTPUT pasm_output_is( << 'CODE', << 'OUTPUT', "Store PMC, get int" ); - new P0, .SArray + new P0, 'SArray' set P0, 2 - new P1, .Integer - set P1, 11 - new P2, .Float - set P2, 1.1 + new P1, 'Integer' + set P1, 11 + new P2, 'Float' + set P2, 1.1 set P0[0], P1 set P0[1], P2 set I0, P0[0] @@ -564,7 +564,7 @@ ok 2 OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Store num, get int" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[0], 4.2 set I0, P0[0] @@ -575,7 +575,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Store string, get int" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[0], "Non-numeric string" set I0, P0[0] @@ -587,12 +587,12 @@ OUTPUT pasm_output_is( << "CODE", << 'OUTPUT', "Store PMC, get num" ); @{[ $fp_equality_macro ]} - new P0, .SArray + new P0, 'SArray' set P0, 2 - new P1, .Integer - set P1, 11 - new P2, .Float - set P2, 1.1 + new P1, 'Integer' + set P1, 11 + new P2, 'Float' + set P2, 1.1 set P0[0], P1 set P0[1], P2 set N0, P0[0] @@ -610,7 +610,7 @@ ok 2 OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Store int, get num" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[0], 12 set N0, P0[0] @@ -621,7 +621,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Store string, get num" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[0], "Non-numeric string" set N0, P0[0] @@ -632,12 +632,12 @@ CODE OUTPUT pasm_output_is( << 'CODE', << 'OUTPUT', "Store PMC, get string" ); - new P0, .SArray + new P0, 'SArray' set P0, 2 - new P1, .String - set P1, "Hello" - new P2, .Integer - set P2, 1010 + new P1, 'String' + set P1, "Hello" + new P2, 'Integer' + set P2, 1010 set P0[0], P1 set P0[1], P2 set S0, P0[0] @@ -655,7 +655,7 @@ ok 2 OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Store int, get string" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[0], 12 set S0, P0[0] @@ -666,7 +666,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Store num, get string" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[0], 12.5 set S0, P0[0] @@ -678,19 +678,19 @@ OUTPUT pasm_output_is( << "CODE", << 'OUTPUT', "Store num, get PMC" ); @{[ $fp_equality_macro ]} - new P0, .SArray + new P0, 'SArray' set P0, 2 set P0[0], 12.239 set P0[1], -1.9742 - new P1, .Float - set P1, P0[0] - set N0, P1 + new P1, 'Float' + set P1, P0[0] + set N0, P1 .fp_eq(N0, 12.239, ok1) print "not " ok1: print "ok 1\\n" - new P2, .Integer - set P2, P0[1] - set N0, P2 + new P2, 'Integer' + set P2, P0[1] + set N0, P2 .fp_eq(N0, -1.9742, ok2) print "not " ok2: print "ok 2\\n" @@ -701,7 +701,7 @@ ok 2 OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Out-of-bounds access: int" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[5], 12 set I0, P0[5] @@ -712,7 +712,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Out-of-bounds access: num" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[5], 12.5 set N0, P0[5] @@ -723,7 +723,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Out-of-bounds access: string" ); - new P0, .SArray + new P0, 'SArray' set P0, 1 set P0[5], "asdf" set S0, P0[5] @@ -734,7 +734,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Out-of-bounds access: push int" ); - new P0, .SArray + new P0, 'SArray' push P0, 12 set I0, P0[0] print I0 @@ -744,7 +744,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Out-of-bounds access: push num" ); - new P0, .SArray + new P0, 'SArray' push P0, 12.09 set N0, P0[0] print N0 @@ -754,7 +754,7 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Out-of-bounds access: push string" ); - new P0, .SArray + new P0, 'SArray' push P0, "Ygnve" set S0, P0[0] print S0 @@ -764,13 +764,13 @@ CODE OUTPUT pasm_error_output_like( << 'CODE', << 'OUTPUT', "Out-of-bounds access: push pmc" ); - new P0, .SArray - new P1, .Integer - set P1, 1234 - push P0, P1 - set I0, P0[0] - print I0 - end + new P0, 'SArray' + new P1, 'Integer' + set P1, 1234 + push P0, P1 + set I0, P0[0] + print I0 + end CODE /SArray index out of bounds/ OUTPUT diff --git a/t/pmc/sharedref.t b/t/pmc/sharedref.t index a11b717271..446a4483e6 100644 --- a/t/pmc/sharedref.t +++ b/t/pmc/sharedref.t @@ -30,7 +30,7 @@ Tests the SharedRef PMC. plan(1) - new P0, .SharedRef + new P0, 'SharedRef' ok(1, 'Instantiated .SharedRef') .end diff --git a/t/pmc/stmlog.t b/t/pmc/stmlog.t index 0788bd351b..5dff5d8703 100644 --- a/t/pmc/stmlog.t +++ b/t/pmc/stmlog.t @@ -30,7 +30,7 @@ Tests the STMLog PMC. plan(1) - new P0, .STMLog + new P0, 'STMLog' ok(1, 'Instantiated .STMLog') .end diff --git a/t/pmc/stmref.t b/t/pmc/stmref.t index a6873fbb32..7e0a99ea78 100644 --- a/t/pmc/stmref.t +++ b/t/pmc/stmref.t @@ -30,7 +30,7 @@ Tests the STMRef PMC. plan(1) - new P0, .STMRef + new P0, 'STMRef' ok(1, 'Instantiated .STMRef') .end diff --git a/t/pmc/stmvar.t b/t/pmc/stmvar.t index 5bec268de9..e4d9a7901f 100644 --- a/t/pmc/stmvar.t +++ b/t/pmc/stmvar.t @@ -30,7 +30,7 @@ Tests the STMVar PMC. plan(1) - new P0, .STMVar + new P0, 'STMVar' ok(1, 'Instantiated .STMVar') .end diff --git a/t/pmc/timer.t b/t/pmc/timer.t index a34a55b021..9f7fe6ba7b 100644 --- a/t/pmc/timer.t +++ b/t/pmc/timer.t @@ -37,7 +37,7 @@ my %platforms = map { $_ => 1 } qw/ pasm_output_is( <<'CODE', <<'OUT', "Timer setup" ); .include "timer.pasm" - new P0, .Timer + new P0, 'Timer' set P0[.PARROT_TIMER_SEC], 7 set I0, P0[.PARROT_TIMER_SEC] eq I0, 7, ok1 @@ -64,14 +64,14 @@ OUT pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer" ); .include "timer.pasm" - new P1, .SArray + new P1, 'SArray' set P1, 4 set P1[0], .PARROT_TIMER_SEC set P1[1], 8 set P1[2], .PARROT_TIMER_USEC set P1[3], 400000 - new P0, .Timer, P1 + new P0, 'Timer', P1 set I0, P0[.PARROT_TIMER_SEC] eq I0, 8, ok1 print "not " @@ -102,7 +102,7 @@ SKIP: { pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start" ); .include "timer.pasm" - new P1, .SArray + new P1, 'SArray' set P1, 6 set P1[0], .PARROT_TIMER_NSEC set P1[1], 0.5 @@ -112,7 +112,7 @@ SKIP: { set P1[4], .PARROT_TIMER_RUNNING set P1[5], 1 - new P0, .Timer, P1 + new P0, 'Timer', P1 print "ok 1\n" sleep 1 print "ok 3\n" @@ -128,7 +128,7 @@ OUT pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/stop" ); .include "timer.pasm" - new P1, .SArray + new P1, 'SArray' set P1, 6 set P1[0], .PARROT_TIMER_NSEC set P1[1], 0.5 @@ -138,7 +138,7 @@ OUT set P1[4], .PARROT_TIMER_RUNNING set P1[5], 1 - new P0, .Timer, P1 + new P0, 'Timer', P1 print "ok 1\n" # stop the timer set P0[.PARROT_TIMER_RUNNING], 0 @@ -155,7 +155,7 @@ OUT pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/repeat" ); .include "timer.pasm" - new P1, .SArray + new P1, 'SArray' set P1, 8 set P1[0], .PARROT_TIMER_NSEC set P1[1], 0.2 @@ -167,7 +167,7 @@ OUT set P1[6], .PARROT_TIMER_RUNNING set P1[7], 1 - new P0, .Timer, P1 + new P0, 'Timer', P1 print "ok 1\n" sleep 1 print "ok 3\n" @@ -185,7 +185,7 @@ OUT pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/destroy" ); .include "timer.pasm" - new P1, .SArray + new P1, 'SArray' set P1, 6 set P1[0], .PARROT_TIMER_NSEC set P1[1], 0.5 @@ -196,7 +196,7 @@ OUT set P1[5], 1 sweep 0 - new P0, .Timer, P1 + new P0, 'Timer', P1 print "ok 1\n" sweep 0 # destroy @@ -216,7 +216,7 @@ OUT pasm_output_is( <<'CODE', <<'OUT', "Timer setup - timer in array destroy" ); .include "timer.pasm" - new P1, .SArray + new P1, 'SArray' set P1, 6 set P1[0], .PARROT_TIMER_NSEC set P1[1], 0.5 @@ -226,15 +226,15 @@ OUT set P1[4], .PARROT_TIMER_RUNNING set P1[5], 1 - new P0, .Timer, P1 + new P0, 'Timer', P1 print "ok 1\n" sweep 0 # hide timer in array set P1[0], P0 - new P0, .Undef + new P0, 'Undef' sweep 0 # un-anchor the array - new P1, .Undef + new P1, 'Undef' # do a lazy DOD run sweep 0 sleep 1 diff --git a/t/pmc/tqueue.t b/t/pmc/tqueue.t index 6e37fa5734..fa366d2ea2 100644 --- a/t/pmc/tqueue.t +++ b/t/pmc/tqueue.t @@ -23,15 +23,15 @@ Tests the thread queue. =cut pasm_output_is( <<'CODE', <<'OUT', "thread safe queue 1" ); - new P10, .TQueue + new P10, 'TQueue' print "ok 1\n" set I0, P10 print I0 print "\n" - new P7, .Integer + new P7, 'Integer' set P7, 2 push P10, P7 - new P7, .Integer + new P7, 'Integer' set P7, 3 push P10, P7 set I0, P10 diff --git a/t/pmc/undef.t b/t/pmc/undef.t index 4442cf8d5b..56a5558488 100644 --- a/t/pmc/undef.t +++ b/t/pmc/undef.t @@ -23,8 +23,8 @@ Tests mainly morphing undef to other types. =cut pasm_output_is( <<'CODE', <<'OUTPUT', "morph to string" ); - new P0, .String - new P1, .Undef + new P0, 'String' + new P1, 'Undef' set P0, "foo" concat P1, P0, P0 print P1 diff --git a/t/pmc/unmanagedstruct.t b/t/pmc/unmanagedstruct.t index 6f168d9e92..5eda483c8c 100644 --- a/t/pmc/unmanagedstruct.t +++ b/t/pmc/unmanagedstruct.t @@ -30,7 +30,7 @@ Tests the UnManagedStruct PMC. plan(1) - new P0, .UnManagedStruct + new P0, 'UnManagedStruct' ok(1, 'Instantiated .UnManagedStruct') .end diff --git a/t/pmc/version.t b/t/pmc/version.t index 36faa14fdf..f58e5981aa 100644 --- a/t/pmc/version.t +++ b/t/pmc/version.t @@ -30,7 +30,7 @@ Tests the Version PMC. plan(1) - new P0, .Version + new P0, 'Version' ok(1, 'Instantiated .Version') .end diff --git a/t/pmc/vtablecache.t b/t/pmc/vtablecache.t index 61e2b561d2..3c46be836d 100644 --- a/t/pmc/vtablecache.t +++ b/t/pmc/vtablecache.t @@ -30,7 +30,7 @@ Tests the VtableCache PMC. plan(1) - new P0, .VtableCache + new P0, 'VtableCache' ok(1, 'Instantiated .VtableCache') .end diff --git a/t/stress/gc.t b/t/stress/gc.t index b75119f1fe..e11ed6dfc8 100644 --- a/t/stress/gc.t +++ b/t/stress/gc.t @@ -26,7 +26,7 @@ use Parrot::PMC qw(%pmc_types); pasm_output_is( <<'CODE', <<'OUTPUT', "arraystress" ); print "starting\n" - new P0, .Integer + new P0, 'Integer' print "ending\n" end CODE