[pypy-commit] lang-smalltalk stmgc-c7: changed argument parsing again for easier usage of smalltalk args

Conrad Calmez noreply at buildbot.pypy.org
Thu Jul 17 10:59:04 CEST 2014


Author: Conrad Calmez <conrad at calmez.net>
Branch: stmgc-c7
Changeset: r896:a0e39d69fbe0
Date: 2014-07-17 10:57 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/a0e39d69fbe0/

Log:	changed argument parsing again for easier usage of smalltalk args
	now you can stop regular argument parsing with "--" and all further
	arguments are for the smalltalk image

diff --git a/images/Squeak4.5-12568.changes b/images/Squeak4.5-12568.changes
--- a/images/Squeak4.5-12568.changes
+++ b/images/Squeak4.5-12568.changes
@@ -15094,4 +15094,4 @@
             ifFalse: [ self organizeMeetingWith: chameleon. first := nil. ] ] atomic value.
"
      tmpString :=  'A Chameneos was in the meeting place and first is now: ' . 
 	SPyVM print: tmpString. "! !
!CPBChameneos methodsFor: 'as yet unclassified' stamp: 'hh 7/10/2014 15:12' prior: 34771049!
run: meetingPlace
     [ color == #faded ] whileFalse: [
	  "SPyVM print: 'Chameneos goes to meeting place' , self color."
         meetingPlace reachedBy: self.
-        waitingForPair lock.
        "SPyVM print: 'Chameneos met another one and releases lock' , self color." ]! !

----QUIT----{10 July 2014 . 3:13 pm} Squeak4.5-benchmarks.image priorSource: 1252802!

----STARTUP----{10 July 2014 . 3:16:52 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!


----QUIT/NOSAVE----{10 July 2014 . 3:17:21 pm} Squeak4.5-benchmarks.image priorSource: 1253908!

----QUIT/NOSAVE----{10 July 2014 . 1:19:47 pm} Squeak4.5-benchmarks.image priorSource: 1253908!

----STARTUP----{10 July 2014 . 5:00:09 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!

!Integer methodsFor: '*SPy-Benchmarks' stamp: 'hh 7/10/2014 17:01'!
OSLockTest
	| lock |
	lock := OSLock new.
	lock release.! !

----QUIT----{10 July 2014 . 5:01:29 pm} Squeak4.5-benchmarks.image priorSource: 1253908!

----STARTUP----{10 July 2014 . 5:04:01 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!


----QUIT/NOSAVE----{10 July 2014 . 5:05:51 pm} Squeak4.5-benchmarks.image priorSource: 1254571!

----STARTUP----{10 July 2014 . 5:35:54 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!


----QUIT/NOSAVE----{10 July 2014 . 5:36:06 pm} Squeak4.5-benchmarks.image priorSource: 1254571!

----STARTUP----{10 July 2014 . 5:44:18 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/Squeak4.5-12568.image!


----QUIT/NOSAVE----{10 July 2014 . 5:44:25 pm} Squeak4.5-12568.image priorSource: 1254571!

----QUIT/NOSAVE----{10 July 2014 . 6:11:07 pm} Squeak4.5-12568.image priorSource: 1254571!

----STARTUP----{10 July 2014 . 6:11:32 pm} as /Users/conrad/Repositories/master-project/lang-smalltalk/images/Squeak4.5-12568.image!


----QUIT/NOSAVE----{10 July 2014 . 6:22:16 pm} Squeak4.5-12568.image priorSource: 1254571!
\ No newline at end of file
+        waitingForPair lock.
        "SPyVM print: 'Chameneos met another one and releases lock' , self color." ]! !

----QUIT----{10 July 2014 . 3:13 pm} Squeak4.5-benchmarks.image priorSource: 1252802!

----STARTUP----{10 July 2014 . 3:16:52 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!


----QUIT/NOSAVE----{10 July 2014 . 3:17:21 pm} Squeak4.5-benchmarks.image priorSource: 1253908!

----QUIT/NOSAVE----{10 July 2014 . 1:19:47 pm} Squeak4.5-benchmarks.image priorSource: 1253908!

----STARTUP----{10 July 2014 . 5:00:09 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!

!Integer methodsFor: '*SPy-Benchmarks' stamp: 'hh 7/10/2014 17:01'!
OSLockTest
	| lock |
	lock := OSLock new.
	lock release.! !

----QUIT----{10 July 2014 . 5:01:29 pm} Squeak4.5-benchmarks.image priorSource: 1253908!

----STARTUP----{10 July 2014 . 5:04:01 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!


----QUIT/NOSAVE----{10 July 2014 . 5:05:51 pm} Squeak4.5-benchmarks.image priorSource: 1254571!

----STARTUP----{10 July 2014 . 5:35:54 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/images/Squeak4.5-benchmarks.image!


----QUIT/NOSAVE----{10 July 2014 . 5:36:06 pm} Squeak4.5-benchmarks.image priorSource: 1254571!

----STARTUP----{10 July 2014 . 5:44:18 pm} as /home/hub/hpi/stm/src/lang-smalltalk/images/Squeak4.5-12568.image!


----QUIT/NOSAVE----{10 July 2014 . 5:44:25 pm} Squeak4.5-12568.image priorSource: 1254571!

----QUIT/NOSAVE----{10 July 2014 . 6:11:07 pm} Squeak4.5-12568.image priorSource: 1254571!

----STARTUP----{10 July 2014 . 6:11:32 pm} as /Users/conrad/Repositories/master-project/lang-smalltalk/images/Squeak4.5-12568.image!


----QUIT/NOSAVE----{10 July 2014 . 6:22:16 pm} Squeak4.5-12568.image priorSource: 1254571!

----STARTUP----{17 July 2014 . 10:51:14 am} as /Users/conrad/Repositories/master-project/lang-smalltalk/images/Squeak4.5-12568.image!


----QUIT/NOSAVE----{17 July 2014 . 10:51:23 am} Squeak4.5-12568.image priorSource: 1254571!

----STARTUP----{17 July 2014 . 10:51:30 am} as /Users/conrad/Repositories/master-project/lang-smalltalk/images/Squeak4.5-12568.image!


	Smalltalk arguments!
!Integer methodsFor: '*SPy-Benchmarks' stamp: 'cc 7/17/2014 10:52'!
argTest
	| |
	SPyVM print: 'Arguments were', Smalltalk arguments.! !

----SNAPSHOT----{17 July 2014 . 10:54:14 am} Squeak4.5-12568.image priorSource: 1254571!
\ No newline at end of file
diff --git a/images/Squeak4.5-12568.image b/images/Squeak4.5-12568.image
index 72cb111b874a0858232e56cb11d5c95ddf8337eb..421974741f7d894e680a98bf8e91400220498d7a
GIT binary patch

[cut]

diff --git a/targetimageloadingsmalltalk.py b/targetimageloadingsmalltalk.py
--- a/targetimageloadingsmalltalk.py
+++ b/targetimageloadingsmalltalk.py
@@ -125,8 +125,8 @@
           -r|--run [code string]
           -b|--benchmark [code string]
           -p|--poll_events
-          -s|--smalltalk-args [argument to pass]
           [image path, default: Squeak.image]
+          [-- [SMALLTALK_ARG [SMALLTALK_ARG ...]]]
     """ % argv[0]
 
 
@@ -146,10 +146,13 @@
     code = None
     as_benchmark = False
     smalltalk_args = []
+    parse_smalltalk_args = False
 
     while idx < len(argv):
         arg = argv[idx]
-        if arg in ["-h", "--help"]:
+        if parse_smalltalk_args:
+            smalltalk_args.append(argv[idx])
+        elif arg in ["-h", "--help"]:
             _usage(argv)
             return 0
         elif arg in ["-j", "--jit"]:
@@ -183,9 +186,8 @@
             code = argv[idx + 1]
             as_benchmark = True
             idx += 1
-        elif arg in ["-s", "--smalltalk-args"]:
-            smalltalk_args.append(argv[idx + 1])
-            idx += 1
+        elif arg in ["--"]:
+            parse_smalltalk_args = True
         elif path is None:
             path = argv[idx]
         else:


More information about the pypy-commit mailing list