equal
deleted
inserted
replaced
407 ! ! |
407 ! ! |
408 |
408 |
409 !MessageNode methodsFor:'checks'! |
409 !MessageNode methodsFor:'checks'! |
410 |
410 |
411 checkCondition |
411 checkCondition |
412 "check ifTrue/ifFalse for plausibility" |
412 "check ifTrue/ifFalse for plausibility. |
|
413 TODO: rewite to use lint/lint rules and apply them before accepting" |
413 |
414 |
414 |args lastArg receiverSelector or1 or2| |
415 |args lastArg receiverSelector or1 or2| |
415 |
416 |
416 receiver isBlock ifTrue:[ |
417 receiver isBlock ifTrue:[ |
417 (Block canUnderstand:selector) ifFalse:[ |
418 (Block canUnderstand:selector) ifFalse:[ |
458 ! |
459 ! |
459 |
460 |
460 checkGlobalFromNameSpaceConflictFor:aNode |
461 checkGlobalFromNameSpaceConflictFor:aNode |
461 "check if aNode is a local-nameSpace's variable, |
462 "check if aNode is a local-nameSpace's variable, |
462 which hides a global from Smalltalk with the same name. |
463 which hides a global from Smalltalk with the same name. |
463 This is especially bad for Error handle: do:... " |
464 This is especially bad for Error handle: do:... |
|
465 TODO: rewite to use lint/lint rules and apply them before accepting" |
464 |
466 |
465 |fullName shortName| |
467 |fullName shortName| |
466 |
468 |
467 aNode isGlobalVariable ifTrue:[ |
469 aNode isGlobalVariable ifTrue:[ |
468 fullName := aNode name. |
470 fullName := aNode name. |
476 |
478 |
477 ^ nil. |
479 ^ nil. |
478 ! |
480 ! |
479 |
481 |
480 checkIdentityCompare |
482 checkIdentityCompare |
|
483 "check #== applied to Floats, Strings or Fractions |
|
484 TODO: rewite to use lint/lint rules and apply them before accepting" |
|
485 |
481 |rec arg1 arg1Value operand| |
486 |rec arg1 arg1Value operand| |
482 |
487 |
483 " |
|
484 check #== applied to Floats, Strings or Fractions |
|
485 " |
|
486 ((selector == #==) or:[selector == #~~]) ifTrue:[ |
488 ((selector == #==) or:[selector == #~~]) ifTrue:[ |
487 (argArray size > 0) ifTrue:[ |
489 (argArray size > 0) ifTrue:[ |
488 arg1 := argArray at:1 |
490 arg1 := argArray at:1 |
489 ]. |
491 ]. |
490 |
492 |
526 |
528 |
527 "Modified: / 08-03-2012 / 01:07:33 / cg" |
529 "Modified: / 08-03-2012 / 01:07:33 / cg" |
528 ! |
530 ! |
529 |
531 |
530 checkInlinability |
532 checkInlinability |
531 "early check for possible inlinability" |
533 "early check for possible inlinability. |
|
534 TODO: rewite to use lint/lint rules and apply them before accepting" |
532 |
535 |
533 |numArgs arg1 arg2 arg3| |
536 |numArgs arg1 arg2 arg3| |
534 |
537 |
535 (numArgs := argArray size) >= 1 ifTrue:[ |
538 (numArgs := argArray size) >= 1 ifTrue:[ |
536 arg1 := argArray at:1. |
539 arg1 := argArray at:1. |
624 "Created: / 2.7.1997 / 17:01:10 / cg" |
627 "Created: / 2.7.1997 / 17:01:10 / cg" |
625 "Modified: / 2.4.1998 / 19:08:54 / cg" |
628 "Modified: / 2.4.1998 / 19:08:54 / cg" |
626 ! |
629 ! |
627 |
630 |
628 plausibilityCheckIn:aParser |
631 plausibilityCheckIn:aParser |
|
632 "some useful checks applied when accepting in a browser. |
|
633 TODO: rewite to use lint/lint rules and apply them before accepting" |
|
634 |
629 |arg1 msg| |
635 |arg1 msg| |
630 |
636 |
631 (argArray size > 0) ifTrue:[ |
637 (argArray size > 0) ifTrue:[ |
632 arg1 := argArray at:1 |
638 arg1 := argArray at:1 |
633 ]. |
639 ]. |
680 ]. |
686 ]. |
681 |
687 |
682 argArray size > 0 ifTrue:[ |
688 argArray size > 0 ifTrue:[ |
683 "/ check for a beginners error (using super as arg) |
689 "/ check for a beginners error (using super as arg) |
684 "/ as in (something ? super) foo |
690 "/ as in (something ? super) foo |
685 |
691 "/ let him know, that this will not be a "super foo" |
686 argArray do:[:arg | arg isSuper ifTrue:[ |
692 argArray do:[:arg | arg isSuper ifTrue:[ |
687 ^ 'super special semantic only with receiver of message sends' |
693 ^ 'super special semantic only with receiver of message sends' |
688 ] |
694 ] |
689 ]. |
695 ]. |
690 ]. |
696 ]. |
3347 ! ! |
3353 ! ! |
3348 |
3354 |
3349 !MessageNode class methodsFor:'documentation'! |
3355 !MessageNode class methodsFor:'documentation'! |
3350 |
3356 |
3351 version |
3357 version |
3352 ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.201 2013-08-26 13:44:37 cg Exp $' |
3358 ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.202 2013-08-31 11:30:42 cg Exp $' |
3353 ! |
3359 ! |
3354 |
3360 |
3355 version_CVS |
3361 version_CVS |
3356 ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.201 2013-08-26 13:44:37 cg Exp $' |
3362 ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.202 2013-08-31 11:30:42 cg Exp $' |
3357 ! |
3363 ! |
3358 |
3364 |
3359 version_SVN |
3365 version_SVN |
3360 ^ '$ Id $' |
3366 ^ '$ Id $' |
3361 ! ! |
3367 ! ! |