-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectDescription.bas
59 lines (51 loc) · 2.66 KB
/
ProjectDescription.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Attribute VB_Name = "ProjectDescription"
Option Explicit
'VBA-Highlighter
'@Desc:
'The VBA-Highlighter analyzes the contents of all #paragraphs with the #ParagraphStyle "Code" #periodically
'and highlights the Syntax of #Keywords, #Datatypes, #Strings and #Comments using #CharacterStyles.
'Custom Keywords generally supported, as long as a corresponding #CharacterStyle exists.
'All #Keywords and #Datatypes are stored in an #ini-file. The identification of a #CharacterStyle
'is done by the name of a category inside of the #ini-file.
'Linebreaks and continuation are not supported
'#ini-file
'The ini-file is structured having a categoryname inside square brackets [] followed by a
'vbCrLf, followed by a list of keywords split by vbCrLf. There must be no duplicates. E.g:
'[Keyword]
'For
'Each
'To
'Next
'[Datatype]
'String
'Integer
'Long
'[ManualHighlight]
'cKeyDict
'Todo
'cKeyword
'#Strings
'String-literals are determined as any number of Characters between two DoubleQuotes inside
'a single Paragraph.
'#Comments
'Comments are determined as being the following Text after a Single Quote ' or
'after the Keyword Rem until the end of the paragraph.
'Single quotes or Rem inside double quotes are considered as being part of a string literal and
'thus not marked as Comment
'#Keywords, #DataTypes and #Customkeywords (KDCs)
'keywords, datatypes and custom keywords are detected by iterating through all words
'inside a paragraph. KDCs are considered being part of a string literal if they appear
'inside double quotes. KDCs are considered being part of a comment if they are found after
'a single quote or Rem.
'#Paragraphs
'Paragraphs are determined by iterating through the built in Paragraphs()-Collection of a
'word Document-Object. Only Paragraphs with the #ParagraphStyle Code are considered.
'#CharacterStyles
'CharacterStyles for (built in) #Keywords, #Datatypes, #Comments and #Strings are mandatory
'and can be generated by the program itself. By default Keywords are styled in a dark-blue color,
'while Datatypes are shown in an orange. Strings are lightly-blue colored, Comments green.
'#ParagraphStyle Code
'Only Paragraphs that are Styled with the "Code"-ParagraphStyle are considered as being relevant.
'The ParagraphStyle "Code" is mandatory and can be generated by the program itself. By default
'the Font is set to "Courier New", the FontSize to 11 and the margin between Paragraphs is set to 0.
'The rest of the style is derived from Standard/General(?).