Cando_干掉注释

/*
;-------------------------------------------------------------------------------
;脚本来自以下网址,转发保留一下信息。
;http://ahkscript.org/boards3/viewtopic.php?f=6&t=687
;   strip===作者:Awannaknow
;   strip1===作者:FanaticGuru
;   取一即可
;-------------------------------------------------------------------------------
*/
Cando_干掉注释:
	CandySel_NC := RegExReplace(CandySel, "(\.*).", "$1(NoComments).")
	CandySel_NC1 := RegExReplace(CandySel, "(\.*).", "$1(NoComments1).")
	Strip(CandySel,CandySel_NC)
	Strip1(CandySel,CandySel_NC1)
	Return

strip1(in,out)
{
	FileRead,string,%in%
	Strip:=RegExReplace(string, "ms`a)(^s*/*.*?^s**/s*v|(?-s)(^s*;.*R|[ t]+;.*)|^s+?v)")	; Removes /* ... */ and ; ... and blank lines
	FileAppend,%Strip%,%out%,UTF-8
}

Strip( in, out )
{
	Loop Read, %in%, %out%
	{
		TwoChars := SubStr(LTrim(A_LoopReadline), 1, 2)
		If (TwoChars = "/*") {
			BlockComment := True
			Continue
		}
		If (TwoChars = "*/") {
			BlockComment := False
			ReadLine := RegExReplace(A_LoopReadLine, "*/s*")
			If (Trim(ReadLine)  "")
            {
				FileAppend %ReadLine% `n
			}
			Continue
		}
		If (BlockComment) {
			Continue
		}
		If (InStr(A_LoopReadline, ";")) {
			ReadLine := RegExReplace(A_LoopReadline, "^;.*$|s+;.*$")
			If (Trim(ReadLine)  "") {
				FileAppend %ReadLine% `n
			}
			Continue
		}
		FileAppend %A_LoopReadLine% `n
	}
}

给TA捐赠
共{{data.count}}人
人已捐赠
其他

cando_创建快捷方式

2020-3-21 12:03:31

其他

cando_智能解压

2020-3-21 12:13:58

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索