Change how trace state report works for clarity
@@ -441,10 +441,6 @@ func CountStats(fileJob *FileJob) {
if fileJob.Content[index] == '\n' || index >= endPoint {
fileJob.Lines++
- if Trace {
- printTrace(fmt.Sprintf("%s line %d ended with state: %d", fileJob.Location, fileJob.Lines, currentState))
- }
-
switch currentState {
case SCode, SString, SCommentCode, SMulticommentCode:
fileJob.Code++
@@ -454,6 +450,9 @@ func CountStats(fileJob *FileJob) {
return
}
}
+ if Trace {
+ printTrace(fmt.Sprintf("%s line %d ended with state: %d: counted as code", fileJob.Location, fileJob.Lines, currentState))
+ }
case SComment, SMulticomment, SMulticommentBlank:
fileJob.Comment++
currentState = resetState(currentState)
@@ -462,6 +461,9 @@ func CountStats(fileJob *FileJob) {
return
}
}
+ if Trace {
+ printTrace(fmt.Sprintf("%s line %d ended with state: %d: counted as comment", fileJob.Location, fileJob.Lines, currentState))
+ }
case SBlank:
fileJob.Blank++
if fileJob.Callback != nil {
@@ -469,6 +471,9 @@ func CountStats(fileJob *FileJob) {
return
}
}
+ if Trace {
+ printTrace(fmt.Sprintf("%s line %d ended with state: %d: counted as blank", fileJob.Location, fileJob.Lines, currentState))
+ }
}
}
}
