From 460eba8d1a5ea8feef28282e70ba2d22fa1fcdc6 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 28 May 2010 14:12:41 +0000 Subject: Add support for 'property' builtin function. * interp/g-timer.boot: Rename property to prop to avoid conflict. * boot/parser.boot (bpAssignLHS): Allow functional places to assign to. * boot/ast.boot (bfPlace): New. (bfAssign): Handle %Place forms. * boot/tokens.boot: property is now translated to GET. --- src/interp/g-timer.boot | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/interp') diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot index 91b48708..85bce196 100644 --- a/src/interp/g-timer.boot +++ b/src/interp/g-timer.boot @@ -44,10 +44,10 @@ namespace BOOT printTimeIfTrue := false $printStorageIfTrue := false -printNamedStatsByProperty(listofnames, property) == - total := +/[GETL(name,property) for [name,:.] in listofnames] +printNamedStatsByProperty(listofnames, prop) == + total := +/[GETL(name,prop) for [name,:.] in listofnames] for [name,:.] in listofnames repeat - n := GETL(name, property) + n := GETL(name, prop) strname := STRINGIMAGE name strval := STRINGIMAGE n sayBrightly concat(bright strname, @@ -57,15 +57,15 @@ printNamedStatsByProperty(listofnames, property) == fillerSpaces(65-# STRINGIMAGE total,'"."),bright STRINGIMAGE total) makeLongStatStringByProperty _ - (listofnames, listofclasses, property, classproperty, units, flag) == + (listofnames, listofclasses, prop, classprop, units, flag) == total := 0 str := '"" - otherStatTotal := GETL('other, property) + otherStatTotal := GETL('other, prop) for [name,class,:ab] in listofnames repeat name = 'other => 'iterate cl := first LASSOC(class,listofclasses) - n := GETL( name, property) - PUT(cl,classproperty, n + GETL(cl,classproperty)) + n := GETL( name, prop) + PUT(cl,classprop, n + GETL(cl,classprop)) total := total + n if n >= 0.01 then timestr := normalizeStatAndStringify n @@ -74,18 +74,18 @@ makeLongStatStringByProperty _ otherStatTotal := otherStatTotal + n str := makeStatString(str,timestr,ab,flag) otherStatTotal := otherStatTotal - PUT('other, property, otherStatTotal) + PUT('other, prop, otherStatTotal) if otherStatTotal > 0 then str := makeStatString(str,normalizeStatAndStringify otherStatTotal,'O,flag) total := total + otherStatTotal cl := first LASSOC('other,listofnames) cl := first LASSOC(cl,listofclasses) - PUT(cl,classproperty, otherStatTotal + GETL(cl,classproperty)) + PUT(cl,classprop, otherStatTotal + GETL(cl,classprop)) if flag ~= 'long then total := 0 str := '"" for [class,name,:ab] in listofclasses repeat - n := GETL(name, classproperty) + n := GETL(name, classprop) n = 0.0 => 'iterate total := total + n timestr := normalizeStatAndStringify n -- cgit v1.2.3