示例#1
0
        private void ComputeLineTypeFromIndicator()
        {
            // Compute line type
            switch (IndicatorChar)
            {
                case ' ':
                    Type = CobolTextLineType.Source;
                    break;
                case '*':
                case '/':
                    Type = CobolTextLineType.Comment;
                    break;
                case 'D':
                case 'd':
                    Type = CobolTextLineType.Debug;
                    break;
                case '-':
                    Type = CobolTextLineType.Continuation;
                    break;
                default:
                    Type = CobolTextLineType.Invalid;
                    break;
            }

            // Detect blank lines
            if ((Type == CobolTextLineType.Source || Type == CobolTextLineType.Debug || Type == CobolTextLineType.Continuation) &&
               (Source.IsEmpty || String.IsNullOrWhiteSpace(SourceText)))
            {
                Type = CobolTextLineType.Blank;
            }
        }
示例#2
0
 private static bool IsInsideRemarks(CobolTextLineType type, string line)
 {
     if (type != CobolTextLineType.Comment || line == null) return false;
     return line.StartsWith("REMARKS. ", StringComparison.InvariantCultureIgnoreCase);
 }