Browse Source

Fixed class functions being added to the commands list

Carl Husberg 5 years ago
parent
commit
fa5c6a66c1
3 changed files with 22 additions and 0 deletions
  1. 2 0
      src/makedocs/docnode.bmx
  2. 7 0
      src/makedocs/docstyle.bmx
  3. 13 0
      src/makedocs/makedocs.bmx

+ 2 - 0
src/makedocs/docnode.bmx

@@ -19,6 +19,8 @@ Type TDocNode
 	Field docDir$		'eg: ../mod/brl.mod/max2d.mod/doc
 	Field example$	'eg: LoadImage.bmx (path)
 	
+	Field block:Int
+	
 	Field children:TList=New TList
 	
 	Function ForPath:TDocNode( path$ )

+ 7 - 0
src/makedocs/docstyle.bmx

@@ -128,6 +128,13 @@ Type TDocStyle Extends TBBLinkResolver
 
 			list.AddLast t
 			
+			If(t.kind = "Function" And t.block)
+				Local i=t.proto.Find( " " )
+				If i<>-1
+					Continue
+				EndIf
+			EndIf
+			
 			'update commands.txt
 			Select t.kind
 			Case "Keyword"

+ 13 - 0
src/makedocs/makedocs.bmx

@@ -123,6 +123,8 @@ Function docBmxFile( filePath$,docPath$ )
 	
 	Local Text$=LoadText( filepath )
 	
+	Local blocks:TList = CreateList()
+	
 	For Local line$=EachIn Text.Split( "~n" )
 
 		line=line.Trim()
@@ -138,6 +140,15 @@ Function docBmxFile( filePath$,docPath$ )
 			i:+1
 		EndIf
 		
+		Select id
+		Case "type", "interface", "struct"
+			ListAddLast(blocks, id)
+			
+		Case "endtype", "endinterface", "endstruct"
+			ListRemoveLast(blocks)
+			
+		EndSelect
+		
 		If inrem
 		
 			If id="endrem"
@@ -263,6 +274,8 @@ Function docBmxFile( filePath$,docPath$ )
 				
 				Local node:TDocNode=TDocNode.Create( id,path,kind, BuildProtoId(proto) )
 				
+				If(Not ListIsEmpty(blocks)) Then node.block = True
+				
 				node.proto=proto
 				node.bbdoc=bbdoc
 				node.returns=returns