Tools__TagList.st
changeset 13153 23ad227fb44e
parent 12744 d06202b4d31c
child 13182 bc686a7cc736
child 13215 187a0aabc409
--- a/Tools__TagList.st	Wed Jul 10 02:21:16 2013 +0200
+++ b/Tools__TagList.st	Wed Jul 10 10:39:01 2013 +0200
@@ -2434,6 +2434,77 @@
     "Modified: / 05-05-2011 / 15:45:55 / cg"
 ! !
 
+!TagList methodsFor:'tag generation - helpers'!
+
+plainTextBetweenHTMLElement:startElement andElementWithTag:endTag
+    "applied to an <h1>-tag element, passing '/h1' as endTag,
+     this retrieves the plain text of the headline. Used by the tag list."
+
+    |el collector hasSpace txt|
+
+    collector := WriteStream on:(String new:100).
+    el := startElement next.
+
+    hasSpace := true.
+    [ el notNil and:[el tag ~= endTag] ] whileTrue:[
+        el isTextElement ifTrue:[
+            hasSpace ifFalse:[
+                collector space.
+                hasSpace := true.
+            ].
+            txt := el text withoutSeparators.
+            txt notEmpty ifTrue:[
+                collector nextPutAll:txt.
+                hasSpace := txt endsWith:' '.
+            ]
+        ].
+        el := el next
+    ].
+    ^ collector contents
+
+    "Created: / 12-09-2012 / 12:38:01 / cg"
+!
+
+tagsForLinesStartingWithIdentifierAndColon:aFilePath
+    "helper for yacc tags (and maybe others in the future):
+     naive, q&d scan for lines matching:
+        <anything>:
+    "
+
+    |targets line l lineNr nm s words w|
+
+    Tag autoload.
+
+    targets := OrderedCollection new.
+    s := aFilePath asFilename readStream.
+    s notNil ifTrue:[
+        s := LineNumberReadStream readingFrom:s.
+        [s atEnd] whileFalse:[
+            line := s nextLine.
+            l := line withoutSeparators.
+            words := l asCollectionOfWords.
+
+            words size >= 1 ifTrue:[
+                w := words first.
+                (w endsWith:$:) ifTrue:[
+                    nm := w copyButLast:1.
+
+                    lineNr := s lineNumber - 1.
+                    targets add:(Tag::TLabel
+                                    label:nm 
+                                    pattern:nil
+                                    type:nil
+                                    lineNumber:lineNr).
+                ].
+            ]
+        ].
+        s close
+    ].
+    ^ targets
+
+    "Created: / 28-09-2012 / 14:45:35 / cg"
+! !
+
 !TagList methodsFor:'tag generation - simple'!
 
 assemblerTagsInFile:aFilePath
@@ -2692,7 +2763,7 @@
 
 htmlTagsInFile:aFilePath
     "hatml tags:
-     naive, q&d scan for lines containing with:
+     naive, q&d scan for lines containing:
         <textarea>
         <input>
         <table>
@@ -3222,35 +3293,6 @@
     ^ targets
 !
 
-plainTextBetweenHTMLElement:startElement andElementWithTag:endTag
-    "applied to an <h1>-tag element, passing '/h1' as endTag,
-     this retrieves the plain text of the headline. Used by the tag list."
-
-    |el collector hasSpace txt|
-
-    collector := WriteStream on:(String new:100).
-    el := startElement next.
-
-    hasSpace := true.
-    [ el notNil and:[el tag ~= endTag] ] whileTrue:[
-        el isTextElement ifTrue:[
-            hasSpace ifFalse:[
-                collector space.
-                hasSpace := true.
-            ].
-            txt := el text withoutSeparators.
-            txt notEmpty ifTrue:[
-                collector nextPutAll:txt.
-                hasSpace := txt endsWith:' '.
-            ]
-        ].
-        el := el next
-    ].
-    ^ collector contents
-
-    "Created: / 12-09-2012 / 12:38:01 / cg"
-!
-
 prologTagsInFile:aFilePath
     "prolog tags:
      naive, q&d scan for lines matching:
@@ -3510,46 +3552,6 @@
     "Created: / 05-01-2012 / 10:56:26 / cg"
 !
 
-tagsForLinesStartingWithIdentifierAndColon:aFilePath
-    "helper for yacc tags (and maybe others in the future):
-     naive, q&d scan for lines matching:
-        <anything>:
-    "
-
-    |targets line l lineNr nm s words w|
-
-    Tag autoload.
-
-    targets := OrderedCollection new.
-    s := aFilePath asFilename readStream.
-    s notNil ifTrue:[
-        s := LineNumberReadStream readingFrom:s.
-        [s atEnd] whileFalse:[
-            line := s nextLine.
-            l := line withoutSeparators.
-            words := l asCollectionOfWords.
-
-            words size >= 1 ifTrue:[
-                w := words first.
-                (w endsWith:$:) ifTrue:[
-                    nm := w copyButLast:1.
-
-                    lineNr := s lineNumber - 1.
-                    targets add:(Tag::TLabel
-                                    label:nm 
-                                    pattern:nil
-                                    type:nil
-                                    lineNumber:lineNr).
-                ].
-            ]
-        ].
-        s close
-    ].
-    ^ targets
-
-    "Created: / 28-09-2012 / 14:45:35 / cg"
-!
-
 tclTagsInFile:aFilePath
     "tcl tags:
      naive, q&d scan for lines matching:
@@ -3659,14 +3661,14 @@
 !TagList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.27 2013-05-07 15:28:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.28 2013-07-10 08:39:01 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.27 2013-05-07 15:28:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.28 2013-07-10 08:39:01 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: Tools__TagList.st,v 1.27 2013-05-07 15:28:52 cg Exp $'
+    ^ '$Id: Tools__TagList.st,v 1.28 2013-07-10 08:39:01 cg Exp $'
 ! !