An Overview of Document Types
This page allows you to define document types and specify special options for document types. There are three types of document types in ExamDiff Pro:
is the default document type that is assigned to all files
that do not match any other document types. This document type cannot be deleted or renamed, and
cannot participate in syntax highlighting and comment ignoring.
System types are
those types that come preinstalled with ExamDiff Pro. They cannot
be deleted or renamed, but can be assigned to different file extensions. These document
types can participate in syntax highlighting and comment ignoring.
- Custom types are those types that are user-created. They are the only types that can be deleted and renamed. These document types can participate in comment ignoring, but cannot participate in syntax highlighting.
Dialog Box OptionsList of document types
Document type details
The name of the document type. Only user-created types can be renamed.
File extensions that the document type applies to.
Regular expression for comments
The regular expression (if any) that defines comments for the document type. This option can only be set for custom types; system types use the same parsing algorithms that are utilized by syntax highlighting. Note that we use the term "comments" in a very broad sense; any single- or multi-line part of a text file can be considered a "comment" as long as it is defined by a regular expression.
Single line comments
Single line comments (such as // in C++), use the following regular expression: [comment symbol].*?\n . For example, the regular expression for C++ style comments is //.*?\n . Note the non-greedy ? operator.
Multi-line comments (such as /* */ in C), use the following regular expression: [start comment symbol].*?[end comment symbol] . For example, the regular expression for C-style comments is /\*.*?\*/ . Again, note the non-greedy ? operator.
Different kinds of comments can be combined ("OR-ed") using the | character. For example, the regular expression /\*.*?\*/|//.*?\n ignores both C and C++ style comments.
- Single line comments
Sets the tab size (that is, the number of spaces in a tab) for the document type. This option only takes effect if Use document type settings is enabled.
Participate in ignoring comments
Ignore the specified comment during comparison. This option only takes effect if Ignore Comments is enabled.
Participate in syntax highlighting
Highlights certain syntax elements during comparison. Diff highlighting takes precedence over syntax highlighting, so syntax highlighting only takes effect on identical blocks. This option can only be enabled for system types, and only takes effect if Use document type settings is enabled.
After syntax highlighting is applied, note that it can always be changed for each file individually, using the Set Document Type option in the context menu.
Participate in scope bar
This read-only option indicates whether a document type is supported by the scope parser, and hence whether scope bars could be shown for this type.
This option is only visible if Participate in syntax highlighting is enabled, and enables you to choose colors for each of the five syntax elements that ExamDiff Pro highlights: keywords, preprocessor commands, comments, operators, and numbers. Note that not all of these elements apply to all document types.
Automatically detect document type for unknown extensions
Document type auto-detection will happen in any of the following situations:
- a file is compared either without a extension or with an extension that doesn't correspond to any known ExamDiff Pro document type
- a comparison is initiated from clipboard contents
- text is pasted into a comparison window from the clipboard