There is no detail explicit rule for that, what I can find is the following inside ~config/cfcolsav.ijs in J602 which I might misread
00-19 system colors 20-39 class colors 40-59 keyword colors 0 bkgnd 1 text 2 selbkgnd 3 seltext 4 margin 5 mark (character digits, not bitmaps) 6 lab text background 7 lab text foreground 8-19 reserved 20 primitive 21 name 22 number 23 string 24 comment 25 open quote 26 first unmatched )( 27 name =: 28 name =. 29 naked ) - explicit definition and lab section close 30-39 reserved 40-59 keywords it is the smcolor 26. I think validation can be done using J602 to see if we can make an exact duplicate of its behavior. Off screen text also needs refresh since there are match for blocks. eg, smcolor 6 and 7 -- (...) ... some lab text .. ) and also classes for Noun definition and Note in jqt. Incidentally current jqt did not implement smcolor 25 (open quote). Пн, 26 дек 2016, Raul Miller написал(а): > It seems to me that in ((() the first two parenthesis are unmatched > and the last two are matched. > > Or, at least, I do not see why I would arbitrarily pick the middle > parenthesis of the three to be the first unmatched one. > > Remember also, that in your original post in this thread you posed this > example: > > a + ((mno - rst) % b NB. unmatched paren > ^ > 01234 > > If it makes sense to have the first of two left parenthesis be the > first unbalanced parenthesis for that example, surely it makes sense > to have the first of three left parenthesis be the first unbalanced > parenthesis in the ((() case. > > That said, if there's some rule which I am overlooking, please let me > know of it. > > Thanks, > > -- > Raul > > > > > > On Mon, Dec 26, 2016 at 7:39 PM, bill lam <[email protected]> wrote: > > '((()' > > shouldn't the first unmatched at index 1 instead of 0? ie use i: instead of > > i. for unmatched (. > > > > > > > > > > On 27 Dec, 2016 8:31 am, "Raul Miller" <[email protected]> wrote: > > > > Ah, good point - I was not properly handling the case where the first > > unmatched parenthesis was the first character on the line. > > > > Also, the close script line is something of a special case, but it's > > easy enough to check for: > > > > With that fix and this change, I'd do something like this: > > > > firstunmatched=:3 :0 > > if. ')' -:&(-.&' ') y do. #y return. end. > > q=. unquoted=. -.~:/\y='''' > > c=. uncommented=. -. +./\ q * 'NB.' E. y > > n=. parendepth=. +/\q*c*-/'()'=/y > > if. 0 < {: n do. > > (n i. _1) <. 1 i:~0 1 E. 0,n > > else. > > n i. _1 > > end. > > ) > > > > Thanks, > > > > -- > > Raul > > > > > > On Mon, Dec 26, 2016 at 7:05 PM, bill lam <[email protected]> wrote: > >> your verb seemed to find unmatched ) only, e.g. failed for > >> '(()' or '(()(' > >> also a line of ) and whitespace belongs to class 'close definition' and > >> should not be flagged as mismatch. > >> > >> > >> On 27 Dec, 2016 2:42 am, "Raul Miller" <[email protected]> wrote: > >> > >>> I'm not sure what you mean by "containing control words" but code > >>> readability issues are usually a call for better code. > >>> > >>> For this, perhaps (warning: lightly tested code): > >>> > >>> firstunmatched=:3 :0 > >>> q=. unquoted=. -.~:/\y='''' > >>> c=. uncommented=. -. +./\ q * 'NB.' E. y > >>> n=. parendepth=. +/\q*c*-/'()'=/y > >>> if. 0 < {: n do. > >>> (n i. _1) <. 1+1 i:~0 1 E. n > >>> else. > >>> n i. _1 > >>> end. > >>> ) > >>> > >>> In other words: ignoring quoted and commented parenthesis, look for > >>> the first occurrence of either an unbalanced right parenthesis or an > >>> unbalanced left parenthesis. > >>> > >>> Let me know, though, if you see any flaws in this implementation. > >>> > >>> Thanks, > >>> > >>> -- > >>> Raul > >>> > >>> > >>> On Mon, Dec 26, 2016 at 12:57 PM, Henry Rich <[email protected]> > > wrote: > >>> > I don't think it is reasonable to treat ')' and 'NB.' as containing > >>> control > >>> > words. It makes the code very hard to read. > >>> > > >>> > Showing the mismatched parenthesis is important enough that it might be > >>> > better to have it even with this deficiency, but it IS a deficiency and > >>> > should be treated as a bug to be fixed someday. > >>> > > >>> > Henry Rich > >>> > > >>> > On 12/26/2016 11:48 AM, bill lam wrote: > >>> >> > >>> >> I double checked with j602, it has no problem in high lighting > >>> >> the unmatched )( in > >>> >> > >>> >> a '+' ((mno - rst) % b NB. )unmatched paren > >>> >> ^ > >>> >> a '+' ((mno - rst) % b ')' NB. )unmatched paren > >>> >> ^ > >>> >> and > >>> >> > >>> >> '(' (=:)) > >>> >> ^ > >>> >> But this is matched and is correct > >>> >> a '+' ((mno - rst) % b ')') NB. )unmatched paren > >>> >> > >>> >> I think it is reasonable to omit this pattern for > >>> >> syntax high-lighting. > >>> >> > >>> > > >>> > ---------------------------------------------------------------------- > >>> > For information about J forums see http://www.jsoftware.com/forums.htm > >>> ---------------------------------------------------------------------- > >>> For information about J forums see http://www.jsoftware.com/forums.htm > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
