So I made a newLISP tool to get my sources smaller.
Here is a code to remove the comment at the end of a code line.
Is there a better way of doing this?
Any ideas?
Code: Select all
(define (striplinecomment completelinestr complinelst newlinestr)
(setq complinelst (parse completelinestr ";"))
(if (>(length complinelst)1)
(if (not(find "\""(last complinelst))) ;when semicolon not part of a string
(begin
(pop complinelst -1)
(setq newlinestr (trim(join complinelst ";")"" "\t"))
)
(setq newlinestr completelinestr)
)
(setq newlinestr completelinestr)
)
newlinestr
)