|
@@ -165,32 +165,10 @@ Class DocsMaker
|
|
Return docs
|
|
Return docs
|
|
End
|
|
End
|
|
|
|
|
|
- Method MungUrl:String( url:String )
|
|
|
|
- url=url.Replace( "_","_0" )
|
|
|
|
- url=url.Replace( "<","_1" )
|
|
|
|
- url=url.Replace( ">","_2" )
|
|
|
|
- url=url.Replace( ",","_3" )
|
|
|
|
- url=url.Replace( "?","_4" )
|
|
|
|
- url=url.Replace( "&","_5" )
|
|
|
|
- url=url.Replace( "@","_6" )
|
|
|
|
- url=url.Replace( ".","_" )
|
|
|
|
- Return url
|
|
|
|
- End
|
|
|
|
-
|
|
|
|
- Method HtmlEsc:String( str:String )
|
|
|
|
- str=str.Replace( "&","&" )
|
|
|
|
- str=str.Replace( "<","<" )
|
|
|
|
- str=str.Replace( ">",">" )
|
|
|
|
- Return str
|
|
|
|
- End
|
|
|
|
-
|
|
|
|
- Method MarkdownEsc:String( str:String )
|
|
|
|
- str=str.Replace( "\","\\" )
|
|
|
|
- str=str.Replace( "_","\_" )
|
|
|
|
- str=str.Replace( "<","\<" )
|
|
|
|
- str=str.Replace( ">","\>" )
|
|
|
|
- Return str
|
|
|
|
- End
|
|
|
|
|
|
+ Method Esc:String( id:String )
|
|
|
|
+ id=id.Replace( "_","\_" )
|
|
|
|
+ Return id
|
|
|
|
+ End
|
|
|
|
|
|
Method DeclSlug:String( decl:Decl,scope:Scope )
|
|
Method DeclSlug:String( decl:Decl,scope:Scope )
|
|
Local ident:=decl.ident.Replace( "@","" )
|
|
Local ident:=decl.ident.Replace( "@","" )
|
|
@@ -263,10 +241,10 @@ Class DocsMaker
|
|
Local flist:=Cast<FuncList>( node )
|
|
Local flist:=Cast<FuncList>( node )
|
|
If flist Return MakeLink( id,flist.funcs[0].fdecl,flist.funcs[0].scope )
|
|
If flist Return MakeLink( id,flist.funcs[0].fdecl,flist.funcs[0].scope )
|
|
|
|
|
|
- Local etype:=Cast<EnumType>( node )
|
|
|
|
|
|
+ Local etype:=TCast<EnumType>( node )
|
|
If etype Return MakeLink( id,etype.edecl,etype.scope.outer )
|
|
If etype Return MakeLink( id,etype.edecl,etype.scope.outer )
|
|
|
|
|
|
- Local ctype:=Cast<ClassType>( node )
|
|
|
|
|
|
+ Local ctype:=TCast<ClassType>( node )
|
|
If ctype Return MakeLink( id,ctype.cdecl,ctype.scope.outer )
|
|
If ctype Return MakeLink( id,ctype.cdecl,ctype.scope.outer )
|
|
|
|
|
|
Return ""
|
|
Return ""
|
|
@@ -280,19 +258,19 @@ Class DocsMaker
|
|
Local type:=scope.FindType( id )
|
|
Local type:=scope.FindType( id )
|
|
If Not type Return ""
|
|
If Not type Return ""
|
|
|
|
|
|
- Local ntype:=Cast<NamespaceType>( type )
|
|
|
|
|
|
+ Local ntype:=TCast<NamespaceType>( type )
|
|
If ntype
|
|
If ntype
|
|
scope=ntype.scope
|
|
scope=ntype.scope
|
|
Continue
|
|
Continue
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local etype:=Cast<EnumType>( type )
|
|
|
|
|
|
+ Local etype:=TCast<EnumType>( type )
|
|
If etype
|
|
If etype
|
|
'stop at enum!
|
|
'stop at enum!
|
|
Return MakeLink( id+"."+path.Slice( i0 ),etype.edecl,etype.scope.outer )
|
|
Return MakeLink( id+"."+path.Slice( i0 ),etype.edecl,etype.scope.outer )
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local ctype:=Cast<ClassType>( type )
|
|
|
|
|
|
+ Local ctype:=TCast<ClassType>( type )
|
|
If ctype
|
|
If ctype
|
|
scope=ctype.scope
|
|
scope=ctype.scope
|
|
Continue
|
|
Continue
|
|
@@ -318,6 +296,9 @@ Class DocsMaker
|
|
Endif
|
|
Endif
|
|
|
|
|
|
If gen
|
|
If gen
|
|
|
|
+ Local adecl:=Cast<AliasDecl>( decl )
|
|
|
|
+ If adecl And adecl.genArgs ident+="<"+(",".Join( adecl.genArgs ))+">"
|
|
|
|
+
|
|
Local cdecl:=Cast<ClassDecl>( decl )
|
|
Local cdecl:=Cast<ClassDecl>( decl )
|
|
If cdecl And cdecl.genArgs ident+="<"+(",".Join( cdecl.genArgs ))+">"
|
|
If cdecl And cdecl.genArgs ident+="<"+(",".Join( cdecl.genArgs ))+">"
|
|
|
|
|
|
@@ -325,10 +306,11 @@ Class DocsMaker
|
|
If fdecl And fdecl.genArgs ident+="<"+(",".Join( fdecl.genArgs ))+">"
|
|
If fdecl And fdecl.genArgs ident+="<"+(",".Join( fdecl.genArgs ))+">"
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Return MarkdownEsc( ident )
|
|
|
|
|
|
+ Return Esc( ident )
|
|
End
|
|
End
|
|
|
|
|
|
Method DeclIdent:String( decl:Decl,scope:Scope,gen:Bool=False )
|
|
Method DeclIdent:String( decl:Decl,scope:Scope,gen:Bool=False )
|
|
|
|
+
|
|
Return MakeLink( DeclIdent( decl,gen ),decl,scope )
|
|
Return MakeLink( DeclIdent( decl,gen ),decl,scope )
|
|
End
|
|
End
|
|
|
|
|
|
@@ -366,28 +348,36 @@ Class DocsMaker
|
|
|
|
|
|
Method TypeName:String( type:Type,prefix:String )
|
|
Method TypeName:String( type:Type,prefix:String )
|
|
|
|
|
|
- Local vtype:=Cast<VoidType>( type )
|
|
|
|
|
|
+ Local xtype:=Cast<AliasType>( type )
|
|
|
|
+ If xtype
|
|
|
|
+
|
|
|
|
+ If xtype.instanceOf xtype=xtype.instanceOf
|
|
|
|
+
|
|
|
|
+ Return MakeLink( Esc( xtype.adecl.ident ),xtype.adecl,xtype.scope )
|
|
|
|
+ Endif
|
|
|
|
+
|
|
|
|
+ Local vtype:=TCast<VoidType>( type )
|
|
If vtype
|
|
If vtype
|
|
Return vtype.Name
|
|
Return vtype.Name
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local gtype:=Cast<GenArgType>( type )
|
|
|
|
|
|
+ Local gtype:=TCast<GenArgType>( type )
|
|
If gtype
|
|
If gtype
|
|
Return gtype.Name.Replace( "?","" )
|
|
Return gtype.Name.Replace( "?","" )
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local ptype:=Cast<PrimType>( type )
|
|
|
|
|
|
+ Local ptype:=TCast<PrimType>( type )
|
|
If ptype
|
|
If ptype
|
|
Local ctype:=ptype.ctype
|
|
Local ctype:=ptype.ctype
|
|
- Return MakeLink( ptype.Name,ctype.cdecl,ctype.scope.outer )
|
|
|
|
|
|
+ Return MakeLink( Esc( ptype.Name ),ctype.cdecl,ctype.scope.outer )
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local ntype:=Cast<NamespaceType>( type )
|
|
|
|
|
|
+ Local ntype:=TCast<NamespaceType>( type )
|
|
If ntype
|
|
If ntype
|
|
- Return ntype.Name
|
|
|
|
|
|
+ Return Esc( ntype.Name )
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local ctype:=Cast<ClassType>( type )
|
|
|
|
|
|
+ Local ctype:=TCast<ClassType>( type )
|
|
If ctype
|
|
If ctype
|
|
Local args:=""
|
|
Local args:=""
|
|
For Local type:=Eachin ctype.types
|
|
For Local type:=Eachin ctype.types
|
|
@@ -397,28 +387,28 @@ Class DocsMaker
|
|
|
|
|
|
If ctype.instanceOf ctype=ctype.instanceOf
|
|
If ctype.instanceOf ctype=ctype.instanceOf
|
|
|
|
|
|
- Return MakeLink( MarkdownEsc( ctype.cdecl.ident ),ctype.cdecl,ctype.scope.outer )+args
|
|
|
|
|
|
+ Return MakeLink( Esc( ctype.cdecl.ident ),ctype.cdecl,ctype.scope.outer )+args
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local etype:=Cast<EnumType>( type )
|
|
|
|
|
|
+ Local etype:=TCast<EnumType>( type )
|
|
If etype
|
|
If etype
|
|
Local name:=etype.Name
|
|
Local name:=etype.Name
|
|
If name.StartsWith( prefix ) name=name.Slice( prefix.Length )
|
|
If name.StartsWith( prefix ) name=name.Slice( prefix.Length )
|
|
- Return MakeLink( MarkdownEsc( name ),etype.edecl,etype.scope.outer )
|
|
|
|
|
|
+ Return MakeLink( Esc( name ),etype.edecl,etype.scope.outer )
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local qtype:=Cast<PointerType>( type )
|
|
|
|
|
|
+ Local qtype:=TCast<PointerType>( type )
|
|
If qtype
|
|
If qtype
|
|
Return TypeName( qtype.elemType,prefix )+" Ptr"
|
|
Return TypeName( qtype.elemType,prefix )+" Ptr"
|
|
Endif
|
|
Endif
|
|
|
|
|
|
- Local atype:=Cast<ArrayType>( type )
|
|
|
|
|
|
+ Local atype:=TCast<ArrayType>( type )
|
|
If atype
|
|
If atype
|
|
If atype.rank=1 Return TypeName( atype.elemType,prefix )+"\[ \]"
|
|
If atype.rank=1 Return TypeName( atype.elemType,prefix )+"\[ \]"
|
|
Return TypeName( atype.elemType,prefix )+"\[ ,,,,,,,,,".Slice( 0,atype.rank+2 )+" \]"
|
|
Return TypeName( atype.elemType,prefix )+"\[ ,,,,,,,,,".Slice( 0,atype.rank+2 )+" \]"
|
|
End
|
|
End
|
|
|
|
|
|
- Local ftype:=Cast<FuncType>( type )
|
|
|
|
|
|
+ Local ftype:=TCast<FuncType>( type )
|
|
If ftype
|
|
If ftype
|
|
Local args:=""
|
|
Local args:=""
|
|
For Local arg:=Eachin ftype.argTypes
|
|
For Local arg:=Eachin ftype.argTypes
|
|
@@ -458,6 +448,25 @@ Class DocsMaker
|
|
Local init:=True
|
|
Local init:=True
|
|
|
|
|
|
For Local node:=Eachin scope.nodes
|
|
For Local node:=Eachin scope.nodes
|
|
|
|
+
|
|
|
|
+ Local atype:=Cast<AliasType>( node.Value )
|
|
|
|
+ If atype
|
|
|
|
+ If kind<>"alias" Continue
|
|
|
|
+ Local decl:=atype.adecl
|
|
|
|
+ If DocsHidden( decl ) Continue
|
|
|
|
+ If inherited<>(scope<>atype.scope) Continue
|
|
|
|
+
|
|
|
|
+ If init
|
|
|
|
+ init=False
|
|
|
|
+ EmitBr()
|
|
|
|
+ Emit( "| Aliases | |" )
|
|
|
|
+ Emit( "|:---|:---" )
|
|
|
|
+ Endif
|
|
|
|
+
|
|
|
|
+ Emit( "| "+DeclIdent( decl,atype.scope )+" | "+DeclDesc( decl )+" |" )
|
|
|
|
+ Continue
|
|
|
|
+ Endif
|
|
|
|
+
|
|
|
|
|
|
Local ctype:=Cast<ClassType>( node.Value )
|
|
Local ctype:=Cast<ClassType>( node.Value )
|
|
If ctype
|
|
If ctype
|
|
@@ -476,7 +485,7 @@ Class DocsMaker
|
|
|
|
|
|
Emit( "| "+DeclIdent( decl,ctype.scope.outer )+" | "+DeclDesc( decl )+" |" )
|
|
Emit( "| "+DeclIdent( decl,ctype.scope.outer )+" | "+DeclDesc( decl )+" |" )
|
|
Continue
|
|
Continue
|
|
- End
|
|
|
|
|
|
+ Endif
|
|
|
|
|
|
Local etype:=Cast<EnumType>( node.Value )
|
|
Local etype:=Cast<EnumType>( node.Value )
|
|
If etype
|
|
If etype
|
|
@@ -494,7 +503,7 @@ Class DocsMaker
|
|
|
|
|
|
Emit( "| "+DeclIdent( decl,etype.scope.outer )+" | "+DeclDesc( decl )+" |" )
|
|
Emit( "| "+DeclIdent( decl,etype.scope.outer )+" | "+DeclDesc( decl )+" |" )
|
|
Continue
|
|
Continue
|
|
- End
|
|
|
|
|
|
+ Endif
|
|
|
|
|
|
Local vvar:=Cast<VarValue>( node.Value )
|
|
Local vvar:=Cast<VarValue>( node.Value )
|
|
If vvar
|
|
If vvar
|
|
@@ -517,7 +526,6 @@ Class DocsMaker
|
|
Local plist:=Cast<PropertyList>( node.Value )
|
|
Local plist:=Cast<PropertyList>( node.Value )
|
|
If plist
|
|
If plist
|
|
If kind<>"property" Continue
|
|
If kind<>"property" Continue
|
|
-
|
|
|
|
Local decl:=plist.pdecl
|
|
Local decl:=plist.pdecl
|
|
If DocsHidden( decl ) Continue
|
|
If DocsHidden( decl ) Continue
|
|
If inherited<>(scope<>plist.scope) Continue
|
|
If inherited<>(scope<>plist.scope) Continue
|
|
@@ -575,6 +583,7 @@ Class DocsMaker
|
|
Emit( "_Module: <"+_module.name+">_ " )
|
|
Emit( "_Module: <"+_module.name+">_ " )
|
|
Emit( "_Namespace: "+nmspace.Name+"_" )
|
|
Emit( "_Namespace: "+nmspace.Name+"_" )
|
|
|
|
|
|
|
|
+ EmitMembers( "alias",nmspace,True )
|
|
EmitMembers( "enum",nmspace,True )
|
|
EmitMembers( "enum",nmspace,True )
|
|
EmitMembers( "struct",nmspace,True )
|
|
EmitMembers( "struct",nmspace,True )
|
|
EmitMembers( "class",nmspace,True )
|
|
EmitMembers( "class",nmspace,True )
|
|
@@ -586,6 +595,22 @@ Class DocsMaker
|
|
Return Flush()
|
|
Return Flush()
|
|
End
|
|
End
|
|
|
|
|
|
|
|
+ Method MakeAliasDocs:String( atype:AliasType )
|
|
|
|
+ Local decl:=atype.adecl
|
|
|
|
+
|
|
|
|
+ If DocsHidden( decl ) Return ""
|
|
|
|
+
|
|
|
|
+ _scope=atype.scope
|
|
|
|
+
|
|
|
|
+ EmitHeader( decl,atype.scope )
|
|
|
|
+
|
|
|
|
+ Emit( "##### Alias "+DeclIdent( decl,True )+" : "+TypeName( atype._alias,atype.scope ) )
|
|
|
|
+
|
|
|
|
+ Emit( decl.docs )
|
|
|
|
+
|
|
|
|
+ Return Flush()
|
|
|
|
+ End
|
|
|
|
+
|
|
Method MakeEnumDocs:String( etype:EnumType )
|
|
Method MakeEnumDocs:String( etype:EnumType )
|
|
Local decl:=etype.edecl
|
|
Local decl:=etype.edecl
|
|
|
|
|
|
@@ -645,6 +670,7 @@ Class DocsMaker
|
|
Emit( decl.docs )
|
|
Emit( decl.docs )
|
|
|
|
|
|
For Local inh:=0 Until 1
|
|
For Local inh:=0 Until 1
|
|
|
|
+ EmitMembers( "alias",ctype.scope,inh )
|
|
EmitMembers( "enum",ctype.scope,inh )
|
|
EmitMembers( "enum",ctype.scope,inh )
|
|
EmitMembers( "struct",ctype.scope,inh )
|
|
EmitMembers( "struct",ctype.scope,inh )
|
|
EmitMembers( "class",ctype.scope,inh )
|
|
EmitMembers( "class",ctype.scope,inh )
|
|
@@ -736,7 +762,7 @@ Class DocsMaker
|
|
|
|
|
|
Local params:=""
|
|
Local params:=""
|
|
For Local i:=0 Until func.ftype.argTypes.Length
|
|
For Local i:=0 Until func.ftype.argTypes.Length
|
|
- Local ident:=MarkdownEsc( func.fdecl.type.params[i].ident )
|
|
|
|
|
|
+ Local ident:=Esc( func.fdecl.type.params[i].ident )
|
|
Local type:=TypeName( func.ftype.argTypes[i],func.scope )
|
|
Local type:=TypeName( func.ftype.argTypes[i],func.scope )
|
|
Local init:=""
|
|
Local init:=""
|
|
If func.fdecl.type.params[i].init
|
|
If func.fdecl.type.params[i].init
|
|
@@ -746,7 +772,7 @@ Class DocsMaker
|
|
Next
|
|
Next
|
|
params=params.Slice( 3 )
|
|
params=params.Slice( 3 )
|
|
|
|
|
|
- Emit( "##### "+tkind+DeclIdent( decl )+" : "+TypeName( func.ftype.retType,func.scope )+" ( "+params+" ) " )
|
|
|
|
|
|
+ Emit( "##### "+tkind+DeclIdent( decl,True )+" : "+TypeName( func.ftype.retType,func.scope )+" ( "+params+" ) " )
|
|
|
|
|
|
Next
|
|
Next
|
|
|
|
|