Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,17 +0,0 @@
|
|||
Dim $Line1 = "apples, pears # and bananas"
|
||||
Dim $Line2 = "apples, pears ; and bananas"
|
||||
|
||||
_StripAtMarker($Line1)
|
||||
_StripAtMarker($Line2)
|
||||
|
||||
Func _StripAtMarker($_Line, $sMarker='# ;')
|
||||
Local $aMarker = StringSplit($sMarker, ' ')
|
||||
Local $iPos
|
||||
For $i = 1 To $aMarker[0]
|
||||
$iPos = StringInStr($_Line, $aMarker[$i])
|
||||
If $iPos Then
|
||||
ConsoleWrite($_Line & @CRLF)
|
||||
ConsoleWrite( StringStripWS( StringLeft($_Line, $iPos -1), 2) & @CRLF)
|
||||
EndIf
|
||||
Next
|
||||
EndFunc ;==>_StripAtMarker
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
Dim $aLines[4] = _
|
||||
[ _
|
||||
"$a = $b + $c ; Comment line 1", _
|
||||
"Dim $s1 = 'some text; tiled with semicolon', $s2 = 'another text; also tiled with semicolon' ; Comment line 2 - semicolon as part of assignment", _
|
||||
"_SomeFunctionCall('string parameter with ;', $anotherParam) ; Comment line 3 - semicolon as part parameter in an function call", _
|
||||
"Func _AnotherFunction($param1=';', $param2=';', $param3=';') ; Comment line 4 - semicolon as default value in parameter of a function headline" _
|
||||
]
|
||||
|
||||
For $i = 0 To 3
|
||||
ConsoleWrite('+> Line ' & $i+1 & ' full:' & @CRLF & '+>' & $aLines[$i] & @CRLF)
|
||||
ConsoleWrite('!> without comment:' & @CRLF & '!>' & _LineStripComment($aLines[$i]) & @CRLF & @CRLF)
|
||||
Next
|
||||
|
||||
|
||||
Func _LineStripComment($_Line)
|
||||
; == tile line by all included comment marker
|
||||
Local $aPartsWithMarker = StringSplit($_Line, ';')
|
||||
Local $sNoComment
|
||||
|
||||
; == if no comment marker: return full line
|
||||
If $aPartsWithMarker[0] = 0 Then Return $_Line
|
||||
|
||||
; == check if string in part, if is'nt: following part(s) are comment
|
||||
For $i = 1 To $aPartsWithMarker[0]
|
||||
If Not StringRegExp($aPartsWithMarker[$i], "('|\x22)") Then
|
||||
If $i = 1 Then
|
||||
Return StringStripWS($aPartsWithMarker[$i], 2)
|
||||
Else
|
||||
Return StringStripWS($sNoComment & $aPartsWithMarker[$i], 2)
|
||||
EndIf
|
||||
Else
|
||||
; == check if next leftside string delimiter has uneven count
|
||||
Local $iLen = StringLen($aPartsWithMarker[$i])
|
||||
Local $fDetectDelim = False, $sStringDelim, $iDelimCount, $sCurr
|
||||
For $j = $iLen To 1 Step -1
|
||||
$sCurr = StringMid($aPartsWithMarker[$i], $j, 1)
|
||||
If Not $fDetectDelim Then
|
||||
If $sCurr = "'" Or $sCurr = '"' Then
|
||||
$sStringDelim = $sCurr
|
||||
$iDelimCount += 1
|
||||
$fDetectDelim = True
|
||||
EndIf
|
||||
Else
|
||||
If $sCurr = $sStringDelim Then $iDelimCount += 1
|
||||
EndIf
|
||||
Next
|
||||
If Mod($iDelimCount, 2) Then
|
||||
; == uneven count: so it masks the comment marker
|
||||
$sNoComment &= $aPartsWithMarker[$i] & ';'
|
||||
Else
|
||||
; == even count: all following is comment
|
||||
Return StringStripWS($sNoComment & $aPartsWithMarker[$i], 2)
|
||||
EndIf
|
||||
EndIf
|
||||
Next
|
||||
EndFunc ;==>_LineStripComment
|
||||
Loading…
Add table
Add a link
Reference in a new issue