jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Bug: if, for, while in Functions menu in SLang mode


Hi,

the keywords if, for and while are shown in the Mode->Functions menu if
they are used outside of a function in SLang mode.

#v+
#! /bin/sh /usr/share/dpatch/dpatch-run
## slmode-function-popup.dpatch by Jörg Sommer <joerg@xxxxxxxxxxxx>
##
## DP: In SLang mode the menu Mode->Functions includes if, while or for if they
## DP: occur outside of a function (which is valid).

@DPATCH@
diff -urNad branches~/lib/cmode.sl branches/lib/cmode.sl
--- branches~/lib/cmode.sl	2006-02-13 18:51:58.000000000 +0100
+++ branches/lib/cmode.sl	2006-07-28 15:11:14.298231102 +0200
@@ -1057,7 +1057,13 @@
 	       continue;
 
 	     c_bskip_over_comment (1);
-	     names[bextract_identifier ()] = what_line ();
+
+             % In SLang you can write statements at the same level like
+             % functions they look like functions but aren't it.
+             variable id = bextract_identifier ();
+             switch (id)
+             { case "if" or case "while" or case "for" or case "switch": }
+             { names[id] = what_line (); }
 	  }
      }
 }
#v-

Bye, Jörg.
-- 
Objektivität ist die Wahnvorstellung, Beobachtungen könnten ohne
Beobachter gemacht werden - Heinz v. Foerster

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]