2013-02-13 23:30 UTC+0100 Viktor Szakats (harbour syenar.net)

* contrib/hbformat/hbfmtcls.prg
  * contrib/hbformat/utils/hbformat.ini
    + allow control for how many spaces to insert (or leave 
      as is) between comment markers and comment text.
      Thanks to Jose F. Gimenez for the bit-perfect patch.
This commit is contained in:
Viktor Szakats
2013-02-13 22:33:19 +00:00
parent ceba217b82
commit d0a94440d9
3 changed files with 13 additions and 2 deletions

View File

@@ -10,6 +10,13 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2013-02-13 23:30 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbformat/hbfmtcls.prg
* contrib/hbformat/utils/hbformat.ini
+ allow control for how many spaces to insert (or leave
as is) between comment markers and comment text.
Thanks to Jose F. Gimenez for the bit-perfect patch.
2013-02-13 22:53 UTC+0100 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/hbmk2.prg
! fixed libname suggestion in a very obscure case

View File

@@ -102,6 +102,7 @@ CREATE CLASS HBFormatCode
VAR nIndCont INIT 3 // Indent for continuation ( after ';' ) lines - amount of spaces
VAR lCnvAst INIT .T. // If true, convert asterisk '*' to '//'
VAR lCnvAmp INIT .T. // If true, convert '&&' to '//'
VAR nSpaceComment INIT 1 // Number of spaces after '//' and '/*' comments ( -1 - no change )
VAR lCnvNot INIT .T. // If true, convert .NOT. TO !
VAR nCaseCmd INIT 1 // Case of commands ( -1 - no change, 1 - upper, 2 - lower, 3 - title )
VAR nCaseBoo INIT 1 // Case of boolean operators ( -1 - no change, 1 - upper, 2 - lower, 3 - title )
@@ -283,8 +284,8 @@ METHOD Reformat( aFile ) CLASS HBFormatCode
ENDIF
IF nPosComment > 0
nPos := nPosComment + iif( SubStr( cLineAll, nPosComment, 1 ) == "*", 1, 2 )
IF SubStr( cLineAll, nPos, 1 ) != " "
cLineAll := Left( cLineAll, nPos - 1 ) + " " + SubStr( cLineAll, nPos )
IF ::nSpaceComment >= 0
cLineAll := Left( cLineAll, nPos - 1 ) + Space( ::nSpaceComment ) + LTrim( SubStr( cLineAll, nPos ) )
ENDIF
ENDIF
IF ( nPos := FindNotQuoted( "/*", cLineAll ) ) != 0 .AND. ( nPosComment == 0 .OR. nPosComment > nPos )

View File

@@ -47,6 +47,9 @@
# If yes, convert '&&' to '//'
#lCnvAmp = yes
# Number of spaces after /* and // comments ( -1 - no change )
#nSpaceComment = 1
# If yes, convert .NOT. TO !
#lCnvNot = yes