rev 473 - trunk/pr
SVN User <[email protected]> Wed, 12 May 2004 18:15:29 -0400
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: bcollins
Date: 2004-05-12 18:15:25 -0400 (Wed, 12 May 2004)
New Revision: 473
Modified:
trunk/pr/bin.pr
trunk/pr/bind.pr
trunk/pr/dictadd.pr
trunk/pr/fixed.pr
trunk/pr/func.pr
trunk/pr/gen.pr
trunk/pr/init.pr
trunk/pr/new.pr
trunk/pr/object.pr
trunk/pr/scope.pr
Log:
Fixup eol-style/executable props.
Modified: trunk/pr/bin.pr
===================================================================
--- trunk/pr/bin.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/bin.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,31 +1,31 @@
-#!/usr/bin/env prothon
-
-# bin.pr
-
-x = Exception
-
-object obj(String, Int):
- Int.init_{obj}(99) # inits using second proto
- print Int.str_{obj}() # prints 99
-
-try:
- with obj: Int.init_{obj}(99) # init Int a second time
-except x,e: print e # throws "object has binary data, expected none"
-
-try:
- obj.init_('abc') # init as String
-except x,e: print e # throws "object has binary data, expected none"
-
-L = Proto(List) # L is uninitialized list
-
-L.init_(1,2,3)
-print L # prints [1, 2, 3]
-
-L.init_(4,5,6)
-print L # prints [4, 5, 6]
-
-d = {1:2, 'a':'b'}
-print d # prints {1:2, 'a':'b'}
-
-d.init_(c = 'd', f = 'g')
+#!/usr/bin/env prothon
+
+# bin.pr
+
+x = Exception
+
+object obj(String, Int):
+ Int.init_{obj}(99) # inits using second proto
+ print Int.str_{obj}() # prints 99
+
+try:
+ with obj: Int.init_{obj}(99) # init Int a second time
+except x,e: print e # throws "object has binary data, expected none"
+
+try:
+ obj.init_('abc') # init as String
+except x,e: print e # throws "object has binary data, expected none"
+
+L = Proto(List) # L is uninitialized list
+
+L.init_(1,2,3)
+print L # prints [1, 2, 3]
+
+L.init_(4,5,6)
+print L # prints [4, 5, 6]
+
+d = {1:2, 'a':'b'}
+print d # prints {1:2, 'a':'b'}
+
+d.init_(c = 'd', f = 'g')
print d # prints {f:'g', c:'d'}
\ No newline at end of file
Property changes on: trunk/pr/bin.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/bind.pr
===================================================================
--- trunk/pr/bind.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/bind.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,19 +1,19 @@
-#!/usr/bin/env prothon
-
-def func():
- print self
-
-bf33 = func{33}
-bf66 = func{66}
-print bf33 # <func:93b7c0:bound:33>
-print bf66 # <func:93b7e0:bound:66>
-
-bf33() # 33
-bf66() # 66
-bf33{77}() # 77
-bf66{88}() # 88
-
-print bf33 # <func:93b7c0:bound:33>
-print bf33.bindObj_ # 33
-del bf33.bindObj_
-print bf33 # <func:93b7c0>
+#!/usr/bin/env prothon
+
+def func():
+ print self
+
+bf33 = func{33}
+bf66 = func{66}
+print bf33 # <func:93b7c0:bound:33>
+print bf66 # <func:93b7e0:bound:66>
+
+bf33() # 33
+bf66() # 66
+bf33{77}() # 77
+bf66{88}() # 88
+
+print bf33 # <func:93b7c0:bound:33>
+print bf33.bindObj_ # 33
+del bf33.bindObj_
+print bf33 # <func:93b7c0>
Property changes on: trunk/pr/bind.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/dictadd.pr
===================================================================
--- trunk/pr/dictadd.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/dictadd.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,22 +1,24 @@
-d={}
-max = 50
-
-def Key(n):
- return "B%02i" % n
-
-print "Loading dictionary ..."
-
-for n in max:
- d[Key(n)] = True
-
-print "\nChecking dictionary ..."
-lost = False
-for n in max:
- if Key(n) not in d:
- lost = True
- print "Key %s not found" % Key(n)
-
-if lost:
- print d.keys().sort!()
-else:
- print "\ntest passed"
+#!/usr/bin/env prothon
+
+d={}
+max = 50
+
+def Key(n):
+ return "B%02i" % n
+
+print "Loading dictionary ..."
+
+for n in max:
+ d[Key(n)] = True
+
+print "\nChecking dictionary ..."
+lost = False
+for n in max:
+ if Key(n) not in d:
+ lost = True
+ print "Key %s not found" % Key(n)
+
+if lost:
+ print d.keys().sort!()
+else:
+ print "\ntest passed"
Property changes on: trunk/pr/dictadd.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/fixed.pr
===================================================================
--- trunk/pr/fixed.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/fixed.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,36 +1,36 @@
-#!/usr/bin/env prothon
-
-object Fixed(Int):
+#!/usr/bin/env prothon
+
+object Fixed(Int):
dp = 2
- divisor = 100
-
- def call_(n=0, decimalplaces=2):
- obj = Proto(self)
+ divisor = 100
+
+ def call_(n=0, decimalplaces=2):
+ obj = Proto(self)
obj.dp = decimalplaces
- obj.divisor = 10
+ obj.divisor = 10
obj.init_(n) # binary data init here
- return obj
-
-object PrettyPrintFixed(Fixed):
+ return obj
- def init_(n):
- Int.init_(n)
- # Set default print format width.
- self.setPrintWidth(self.dp+5)
-
- def setPrintWidth(wid):
- # Create string comprehension "%W.Pf"
- # where W is wid and P is selfdp
- self.pattern = "%%%i.%if" % (wid, self.dp)
- print self.pattern
+object PrettyPrintFixed(Fixed):
+
+ def init_(n):
+ Int.init_(n)
+ # Set default print format width.
+ self.setPrintWidth(self.dp+5)
+ def setPrintWidth(wid):
+ # Create string comprehension "%W.Pf"
+ # where W is wid and P is selfdp
+ self.pattern = "%%%i.%if" % (wid, self.dp)
+ print self.pattern
+
def str_():
- return self.pattern % (self / self.divisor)
-
-print """
-This should print
-
-%6.1f
-123456.7
-"""
-print PrettyPrintFixed(1234567, 1)
+ return self.pattern % (self / self.divisor)
+
+print """
+This should print
+
+%6.1f
+123456.7
+"""
+print PrettyPrintFixed(1234567, 1)
Property changes on: trunk/pr/fixed.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/func.pr
===================================================================
--- trunk/pr/func.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/func.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,27 +1,29 @@
-print """
-
-following should print
-
-f1 a
-f2 b
-f2 c
-f1 d
-f2 e
-"""
-def f1(x=''):
- print 'f1 '+x
-
-def f2(y=''):
- print 'f2 '+y
-
-f = Proto(f1)
-f.init_(f2)
-
-f1('a')
-f2('b')
-f('c')
-
-g = Func(f1)
-h = Func(f2)
-g('d')
-h('e')
+#!/usr/bin/env prothon
+
+print """
+
+following should print
+
+f1 a
+f2 b
+f2 c
+f1 d
+f2 e
+"""
+def f1(x=''):
+ print 'f1 '+x
+
+def f2(y=''):
+ print 'f2 '+y
+
+f = Proto(f1)
+f.init_(f2)
+
+f1('a')
+f2('b')
+f('c')
+
+g = Func(f1)
+h = Func(f2)
+g('d')
+h('e')
Property changes on: trunk/pr/func.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/gen.pr
===================================================================
--- trunk/pr/gen.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/gen.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,14 +1,16 @@
-gen outer(n)
- x = -1
- def inner()
- return &x
- yield inner
- for x in range(n)
- yield x
-
-iter = outer(10)
-inner = iter.next()
-
-print inner()
-for x in iter
- print x, inner()
+#!/usr/bin/env prothon
+
+gen outer(n)
+ x = -1
+ def inner()
+ return &x
+ yield inner
+ for x in range(n)
+ yield x
+
+iter = outer(10)
+inner = iter.next()
+
+print inner()
+for x in iter
+ print x, inner()
Property changes on: trunk/pr/gen.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/init.pr
===================================================================
--- trunk/pr/init.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/init.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,21 +1,21 @@
-#!/usr/bin/env prothon
-
-# init.pr
-
-print
-print """This should print:
-0 1234 0 -1
-0 12.34 .333333
- abc 123
-() (1, 2, 3) (4, 5, 6)
-[] [1, 2, 3] [4, 5, 6]
-{1:2, 3:4} {a:1, b:2, c:3}
-
-"""
-
-print Int(), Int(1234), Int(1//3), Int(-01)
-print Float(), Float(12.34), Float(1/3) # Float(-0.1) ERR XXX
-print String(), String("abc"), String(123)
-print Tuple(), Tuple(*(1,2,3)), Tuple(4,5,6)
-print List(), List(*[1,2,3]), List(4,5,6)
-print Dict(**{1:2, 3:4}), Dict(a=1, b=2, c=3)
+#!/usr/bin/env prothon
+
+# init.pr
+
+print
+print """This should print:
+0 1234 0 -1
+0 12.34 .333333
+ abc 123
+() (1, 2, 3) (4, 5, 6)
+[] [1, 2, 3] [4, 5, 6]
+{1:2, 3:4} {a:1, b:2, c:3}
+
+"""
+
+print Int(), Int(1234), Int(1//3), Int(-01)
+print Float(), Float(12.34), Float(1/3) # Float(-0.1) ERR XXX
+print String(), String("abc"), String(123)
+print Tuple(), Tuple(*(1,2,3)), Tuple(4,5,6)
+print List(), List(*[1,2,3]), List(4,5,6)
+print Dict(**{1:2, 3:4}), Dict(a=1, b=2, c=3)
Property changes on: trunk/pr/init.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/new.pr
===================================================================
--- trunk/pr/new.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/new.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,26 +1,26 @@
-#!/usr/bin/env prothon
-
-def New(proto, *args, **kwargs):
- newObj = Proto(proto)
- newObj.init_(*args, **kwargs)
- return newObj
-
-p = Object()
-with p:
- $x = None
- def $init_(x):
- $x = x
- def $str_():
- return '*'+$x+'*'
-
-print
-print 'Should print ...'
-print '*1*'
-print '*a*'
-print
-
-x = New(p, 1)
-print x
-
-y = New(p, 'a')
-print y
+#!/usr/bin/env prothon
+
+def New(proto, *args, **kwargs):
+ newObj = Proto(proto)
+ newObj.init_(*args, **kwargs)
+ return newObj
+
+p = Object()
+with p:
+ $x = None
+ def $init_(x):
+ $x = x
+ def $str_():
+ return '*'+$x+'*'
+
+print
+print 'Should print ...'
+print '*1*'
+print '*a*'
+print
+
+x = New(p, 1)
+print x
+
+y = New(p, 'a')
+print y
Property changes on: trunk/pr/new.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: trunk/pr/object.pr
===================================================================
--- trunk/pr/object.pr 2004-05-12 21:34:39 UTC (rev 472)
+++ trunk/pr/object.pr 2004-05-12 22:15:25 UTC (rev 473)
@@ -1,22 +1,22 @@
-#!/usr/bin/env prothon
-
-# object.pr
-
-object Point(Object):
- self.x = 0; self.y = 0
- def self.init_(x, y):
- self.x=x; self.y=y
- def self.move(xofs, yofs):
- self.x += xofs; self.y += yofs
- print self.
- def self.str_():
- return '<'+self.x+':'+self.y+'>'
-
-print
-print "Should print..."
-print '<5:50>'
-print '<15:150>'
-print
-p = Point(5, 50)
-print p
-p.move(10, 100)
+#!/usr/bin/env prothon
+
+# object.pr
+
+object Point(Object):
+ self.x = 0; self.y = 0
+ def self.init_(x, y):
+ self.x=x; self.y=y
+ def self.move(xofs, yofs):
+ self.x += xofs; self.y += yofs
+ print self.
+ def self.str_():
+ return '<'+self.x+':'+self.y+'>'
+
+print
+print "Should print..."
+print '<5:50>'
+print '<15:150>'
+print
+p = Point(5, 50)
+print p
+p.move(10, 100)
Property changes on: trunk/pr/object.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Property changes on: trunk/pr/scope.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native