Changeset 38


Ignore:
Timestamp:
10/09/11 00:54:12 (7 months ago)
Author:
sevo
Message:
- partially fixed classic vb property handling (fixes #2)
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/samples/ClassicVB/VB6Class.cls

    r37 r38  
    2020    Private someInteger As Integer ' simple private integer value 
    2121    Public someString As String    ' simple public string value 
     22    Private someObject As Object   ' some object 
    2223 
    2324    ''' <summary> 
     
    2627    ''' <value>some string</value> 
    2728    ''' <returns>some string</returns> 
     29    Public Property Let StringProperty(value As String) 
     30            someString = value 
     31    End Property 
    2832    Public Property Get StringProperty() As String 
    2933            StringProperty = someString 
    30     End Property 
    31     Public Property Set StringProperty(ByVal value As String) 
    32             someString = value 
    3334    End Property 
    3435 
     
    4041    Public Property Get IntegerProperty() As Integer 
    4142            IntegerProperty = someInteger 
     43    End Property 
     44 
     45    ''' <summary> 
     46    ''' reference property 
     47    ''' </summary> 
     48    ''' <value>some object</value> 
     49    ''' <returns>some object</returns> 
     50    Public Property Set ObjectProperty(value As Object) 
     51            Set someObject = value 
     52    End Property 
     53    Public Property Get ObjectProperty() As Object 
     54            ObjectProperty = someObject 
     55    End Property 
     56 
     57    ''' <summary> 
     58    ''' not working property 
     59    ''' </summary> 
     60    ''' <remarks> 
     61    ''' this property will be seen as ReadOnly by the Doxygen vbfilter 
     62    ''' because Set does not preceed get! 
     63    ''' </remarks> 
     64    Public Property Get TestProperty() As Object 
     65            ObjectProperty = someObject 
     66    End Property 
     67    Public Property Set TestProperty(value As Object) 
     68            Set someObject = value 
    4269    End Property 
    4370 
  • trunk/vbfilter.awk

    r37 r38  
    6464        insideComment=0; 
    6565        insideImports=0; 
     66        instideVB6Property=0; 
    6667        isInherited=0; 
    6768        lastLine=""; 
     
    718719# Properties 
    719720############################################################################# 
    720 # skip VB6 Set/Let Property methods 
    721 /.*Property[[:blank:]]+Set[[:blank:]]+/ || 
    722 /.*Property[[:blank:]]+Let[[:blank:]]+/ { next; } 
    723721 
    724722/^Property[[:blank:]]+/ || 
     
    732730                $0=gensub("[(][)]","","g"); 
    733731        } 
     732         
    734733        # add c# styled get/set methods 
    735         if (match($0,"ReadOnly")) { 
     734        if ((match($0,"ReadOnly")) || (match($0,"Get"))) { 
    736735                #sub("ReadOnly[[:blank:]]",""); 
    737                 $0=$0 "\n" appShift "{ get { }; }"; 
    738         } else { 
    739                 $0=$0 "\n" appShift "{ get{ }; set{ }; }"; 
    740         } 
    741         print appShift $0; 
    742         next; 
    743 } 
     736                if (instideVB6Property == 1) 
     737                { 
     738                        instideVB6Property = 0; 
     739                        $0=gensub(" Get| Set| Let","","g"); 
     740                        print appShift $0 "\n" appShift "{ get; set; }"; 
     741                } 
     742                else 
     743                { 
     744                        $0=gensub(" Get| Set| Let","","g"); 
     745                        print appShift $0 "\n" appShift "{ get; }"; 
     746                } 
     747        } else { 
     748                if ((match($0, "Let") || match($0, "Set"))) { 
     749                        instideVB6Property = 1; 
     750                        next; 
     751                } 
     752                        $0=gensub(" Get| Set| Let","","g"); 
     753                print appShift $0 "\n" appShift "{ get; set; }"; 
     754                next; 
     755        } 
     756        instideVB6Property = 0; 
     757        next; 
     758} 
     759 
    744760 
    745761/.*Operator[[:blank:]]+/ { 
Note: See TracChangeset for help on using the changeset viewer.