09-09-2010, 03:01 +0200
Compose post 
User name
Subject (LEAVE EMPTY, NICHTS EINTRAGEN):
Subject :
Verification code:VeriWord Can you read this?
Advanced BBCode:    More...
Text:Smilies:
:-);-):cheesy::-D:-p
:red::-/:-(:'(:cool:
:motz::finger::#::*):zzz:
:heart::moody::gun::anx::-O
:rolleyes:8-(:listen::wand::vogel:

 Special characters:
©®±¼½
αβγδελμπφωΔΣΩ
  (Alt+S) (Alt+P)
Text length: Chars (Maximum: 20000)
Options:
Attach file:   (Maximum: 500 kB)
You should first select the file when finally sending the post, because it can't be saved otherwise.

The last posts in this thread   (newest first, maximum 10 posts)
AuthorPost
Luminous  07-06-2010, 21:50
Member for 2 months
2 Posts
Not a problem. :)  Glad it was an easy fix.
thommey  07-06-2010, 00:28 Jabber
(Administrator)
Member since 03/2004
54 Posts
The warning is actually generated by pretty simple code (not even close to what would be required to do that perfectly) and shouldn't even be there anymore, we just disabled it after you report. (the automatic syntaxchecker is way more accurate and replaces the need for that). However, the same bit of code is responsible for colorizing pairs or {} and [] and thanks to your bugreport we fixed that:       #TCL                            
                                                             
 http://paste.tclhelp.net
                                                                                                                            
                       
The file- or paste-id you specified is not on this server
 
                                                                                                                                                                                                           
                   
                                                                                                                                                                                                                                                                                                                                                                                                       
 
                                                                                                                                                                                   
Switches:                                                                                                                                                                                      
?
                                                                                                                                                                                                               
Remember Settings (Cookie):                                                                                                                                                                                                                        
?
                                                                                                                                                       
Special:                                                                                                                                                                                      
?
                                                                                                                                                                                 
Syntax Highlight                                                                                                                                                                                                                        
?
                                                                                                                                                                                   
Indent                                                                                                                                                                                                                        
?
                                                                                                                                                                                   
Syntax                                   Check                                                                                                                                                                                                                        
?
                           
                   
                 
 
                Powered by TCL
                  Found a bug? Any questions, hints, tips or suggestions? Feel free to visit our forum and post!                
   

The closing ] in the regular expression is now the same as the one before (it used to be black).

Thanks for your detailed report and tracking down this bug!
Luminous  07-05-2010, 23:53 | I found a bug
Member for 2 months
2 Posts
Had an interesting experience with the site today... was giving a script to a friend when upon pasting, it reported a missing brace. I was quite sure there was no missing brace, as my script works perfectly, so I spent time tracking it down to the section and discovered it was this regex causing the error: {([[:alnum:]]+)[-./\\]*\1+} What happened, is that the site tried to escape the ] rather than the backslash in that regex. It doesn't see the escape as "\\". I even tried a single \ and it still tried to escape the ]. Adding another ] clears it, but will also break the script if loaded.
hm2k  11-06-2009, 14:46
Member since 10/2009
4 Posts
Thanks.

I have suggested to the author of a possibility of an -eggdrop option using your patch, which would be nice.

Not had a reply yet though.
thommey  11-06-2009, 01:27 Jabber
(Administrator)
Member since 03/2004
54 Posts
I rarely touch that code, I haven't made any changes to that for almost two years (I just properly generated that patchfile, so I can update nagelfar but still keep my changes). I'll try to remember to change the paste above and post here that I updated it. (So having this thread on your watchlist should do). It's not worth putting that into a CMS :)
hm2k  11-04-2009, 13:00
Member since 10/2009
4 Posts
Thanks for sharing that.

Do you maintain this version in an open repository?

It would be nice to stay up to date.
thommey  10-27-2009, 12:41 Jabber
(Administrator)
Member since 03/2004
54 Posts
I modified nagelfar to check for eggdrop's bind instead of Tk's bind.
(No one pastes Tk, ever, afaik ;).
The full patch I applied to nagelfar is:

                                                                                                                              
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
--- nagelfar.tcl    2009-07-19 19:18:25.421025665 +0200
+++ nagelfar.tcl    2009-10-27 13:36:48.181154390 +0100
@@ -24,10 +24,10 @@
 # $Revision: 424 $
 #----------------------------------------------------------------------
 # the next line restarts using tclsh \
-exec tclsh "$0" "$@"
+exec tclsh8.5 "$0" "$@"
 
 set debug 0
-package require Tcl 8.4
+package require Tcl 8.5
 
 package provide app-nagelfar 1.0
 set version "Version 1.1.9 2008-09-05"
@@ -132,9 +132,19 @@
     }
 }
 
+proc Text2Html {data} {
+   string map {\& \&amp; \< \&lt; \> \&gt; \" \&quot;} $data
+}
+
 # Standard error message.
 # severity : How severe a message is E/W/N for Error/Warning/Note
 proc errorMsg {severity msg i} {
+    if {$::Prefs(html)} {
+      set msg [Text2Html $msg]
+      if {$msg == "Expr without braces"} { append msg " (see <a href=\"http://tclhelp.net/unb/194\" target=\"_tclforum\">http://tclhelp.net/unb/194</a>)" }
+    }
+    if {[string match debug* $msg]} { return 0 }
+
     if {[info exists ::Nagelfar(currentMessage)] && \
             $::Nagelfar(currentMessage) != ""} {
         lappend ::Nagelfar(messages) [list $::Nagelfar(currentMessageLine) \
@@ -157,7 +167,15 @@
         set pre "$::currentFile: "
     }
     set line [calcLineNo $i]
+
+    switch -exact -- $severity {
+        E { set color "#DD0000"; set severity "ERROR" }
+        W { set color "#FFAA00"; set severity "WARNING" }
+        N { set color "#66BB00"; set severity "NOTICE" }
+    }
     set pre "${pre}Line [format %3d $line]: $severity "
+    if {$::Prefs(html)} { set pre "<a href=#$::Prefs(prefix)$line>Line [format %3d $line]</a>: <font color=$color><strong>$severity</strong></font>: " }
+
     set ::Nagelfar(indent) [string repeat " " [string length $pre]]
     set ::Nagelfar(currentMessage) $pre$msg
     set ::Nagelfar(currentMessageLine) $line
@@ -180,6 +198,27 @@
     set ::Nagelfar(commentbrace) {}
 }
 
+proc sortmsgs {msg1 msg2} {
+  if {$msg1 == $msg2} { return 0 }
+  set htmlmask "href=#$::Prefs(prefix)(\\d+)>"
+  set normmask "Line\\s+(\\d+):"
+  if {![info exists ::sortRE]} {
+    if {$::Prefs(html)} { set ::sortRE $htmlmask } else { set ::sortRE $normmask }
+    # cache
+    regexp -- $::sortRE ""
+  } 
+  regexp -- $::sortRE $msg1 -> line1
+#puts "Matching '$re' against '$msg1' -> [info exists line1]"
+  regexp -- $::sortRE $msg2 -> line2
+#puts "Matching '$re' against '$msg2' -> [info exists line2]"
+  if {![info exists line1] || ![info exists line2]} {
+     puts stderr "Could not sort messages! Wrong format! (html: $::Prefs(html))"; return -1
+  }
+  if {$line1 > $line2} { return 1 } else { return -1 }
+  return 0
+}
+
+
 # Called after a file has been parsed, to flush messages
 proc flushMsg {} {
     if {[info exists ::Nagelfar(currentMessage)] && \
@@ -187,7 +226,8 @@
         lappend ::Nagelfar(messages) [list $::Nagelfar(currentMessageLine) \
                 $::Nagelfar(currentMessage)]
     }
-    set msgs [lsort -integer -index 0 $::Nagelfar(messages)]
+#    set msgs [lsort -integer -index 0 $::Nagelfar(messages)]
+    set msgs [lsort -unique -increasing -command sortmsgs $::Nagelfar(messages)]
     foreach msg $msgs {
         set text [lindex $msg 1]
         set print 1
@@ -385,6 +425,7 @@
             if {$i == -1} {
                 # This should never happen since no incomplete lines should
                 # reach this function.
+#         puts "Unable to parse this line. Missing ' ' before '\{' perhaps? (Line [expr {$index + $i}])"
                 decho "Internal error: Did not find close char in scanWord.\
                         Line [calcLineNo $index]."
                 return $len
@@ -1591,6 +1632,7 @@
     # If the command contains substitutions we can not determine
     # which command it is, so we skip it, unless the type is known
     # to be an object.
+
     if {($cmdws & 1) == 0} {
         if {[string match "_obj,*" $cmdtype]} {
             set cmd $cmdtype
@@ -1630,6 +1672,7 @@
     # have their own special check implemented here.
     # Any command that can be checked by checkCommand should
     # be in the syntax database.
+
     switch -glob -- $cmd {
     proc {
         if {$argc != 3} {
@@ -1651,11 +1694,22 @@
         parseProc $argv $indices
             set noConstantCheck 1
     }
-    .* { # FIXA, check code in any -command.
-             # Even widget commands should be checked.
-         # Maybe in checkOptions ?
-        return
-    }
+        bind { # eggdrop bind!
+            if {$argc != 3 && $argc != 4} { WA; return }
+            foreach {type flags keyw cmd} $argv { break }
+            switch -exact -- [string tolower $type] {
+                load - unld - evnt - disc { set argnum 1 }
+                link - nkch - filt - need - wall - chon - choff { set argnum 2 }
+                sent - rcvd - note - act - bcst - chat - raw - bot - fil - away - dcc { set argnum 3 }
+                msg - msgm - splt - rejn - chpt - join { set argnum 4 }
+                flud - time - nick - notc - sign - topc - lost - tout - pub - pubm - part { set argnum 5 }
+                mode - ctcp - ctcr - chjn - kick { set argnum 6 }
+                default { errorMsg W "Unknown bind type: $type" $index; return }
+            }
+            set appendstr [string repeat " bla" $argnum]
+            append cmd $appendstr
+            parseBody $cmd [lindex $indices 3] knownVars
+       }
     global {
         foreach var $argv ws $wordstatus {
         if {$ws & 1} {
@@ -2348,9 +2402,9 @@
                     if {$tmp != $closeBrace} {
                         # Only do this if there is a free open brace
                         if {[regexp "\{\n" $tryline]} {
-                            errorMsg N "Close brace not aligned with line\
-                                    [calcLineNo $index] ($tmp $closeBrace)" \
-                                    $closeBraceIx
+#                            errorMsg N "Close brace not aligned with line\
+#                                    [calcLineNo $index] ($tmp $closeBrace)" \
+#                                    $closeBraceIx
                         }
                     }
                 }
@@ -3626,6 +3680,7 @@
 
 # Make next "E" error visible
 proc seeNextError {} {
+
     set w $::Nagelfar(resultWin)
     set lineNo [lindex [split [$w index insert] .] 0]
 
@@ -4716,6 +4771,8 @@
         editor internal
         extensions {.tcl .test .adp .tk}
         exitcode 0
+        html 0
+        prefix ""
     }
 
     # Do not load anything during test
@@ -4834,6 +4891,8 @@
  -encoding <enc>   : Read script with this encoding.
  -filter <p>       : Any message that matches the glob pattern is suppressed.
  -severity <level> : Set severity level filter to N/W/E (default N).
+ -html             : Generate html-output.
+ -prefix <pref>    : Prefix for line anchors (html output)
  -novar            : Disable variable checking.
  -WexprN           : Sets expression warning level to N.
    2 (def)         = Warn about any unbraced expression.
@@ -5042,6 +5101,13 @@
                     exit
                 }
             }
+            -html {
+                set ::Prefs(html) 1
+            }
+            -prefix {
+                incr i
+                set ::Prefs(prefix) [lindex $argv $i]
+            }
          -tab {
                 incr i
                 set arg [lindex $argv $i]
@@ -5112,6 +5178,7 @@
     }
 
     doCheck
+
     #_dumplogme
     #if {[array size _stats] > 0} {
     #    array set _apa [array get _stats]

hm2k  10-27-2009, 10:01
Member since 10/2009
4 Posts
Is any stripping done to ignore errors such as:

Line N: E Wrong number of arguments (4) to "bind"

Since the bind command with tcl is different to the one in eggdrop.
thommey  10-26-2009, 23:33 Jabber
(Administrator)
Member since 03/2004
54 Posts
Nothing special.

1  nagelfar.tcl -quiet -html -Welse0 -prefix l <file to test>

Where -html and -prefix are modifications to nagelfar so it generates html output suitable for integration into the pastesite (non-standard options).
This post was edited 1 times, last on 10-26-2009, 23:34 by thommey
hm2k  10-26-2009, 23:28
Member since 10/2009
4 Posts
What options are used with nagelfar?
Unclassified NewsBoard 1.5.3-d | © 2003-4 by Yves Goergen