Mercurial > projects > dil
annotate src/config.d @ 839:4063da6f3edd default tip
Refactored the config file and how it is loaded.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Thu, 21 Aug 2008 17:51:04 +0200 |
parents | bcb74c9b895c |
children |
rev | line source |
---|---|
758
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
1 /// The configuration file of dil. |
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
2 /// |
839
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
3 /// The file is searched for in the following order: |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
4 /// $(OL |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
5 /// $(LI The environment variable DILCONF.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
6 /// $(LI The current working directory.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
7 /// $(LI The directory set in the environment variable HOME.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
8 /// $(LI The executable's directory.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
9 /// ) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
10 /// The program will fail with an error msg if the file couldn't be found.$(BR) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
11 /// |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
12 /// The following variables are expanded inside strings (only where paths are expected): |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
13 /// $(UL |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
14 /// $(LI ${DATADIR} -> the data directory of dil (e.g. /home/user/dil/bin/data or C:\dil\bin\data).) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
15 /// $(LI ${HOME} -> the home directory (e.g. /home/name or C:\Documents and Settings\name).) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
16 /// $(LI ${EXECDIR} -> the absolute path to the directory of dil's executable (e.g. /home/name/dil/bin).) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
17 /// ) |
758
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
18 module config; |
513
6160ab7b1816
Refactored code related to settings.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
367
diff
changeset
|
19 |
839
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
20 /// Files needed by dil are located in this directory. |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
21 /// |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
22 /// A relative path is resolved from the directory of dil's executable. |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
23 var DATADIR = "data/"; |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
24 |
778
78be32e3e157
Implemented conditional compilation.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
770
diff
changeset
|
25 /// Predefined version identifiers. |
839
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
26 var VERSION_IDS = ["X86", "linux", "LittleEndian"]; |
778
78be32e3e157
Implemented conditional compilation.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
770
diff
changeset
|
27 // "X86_64", "Windows", "Win32", "Win64", "BigEndian" |
78be32e3e157
Implemented conditional compilation.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
770
diff
changeset
|
28 |
758
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
29 /// An array of import paths to look for modules. |
839
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
30 /// |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
31 /// Relative paths are resolved from the current working directory. |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
32 var IMPORT_PATHS = []; /// E.g.: ["src/", "import/"] |
758
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
33 |
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
34 /// DDoc macro file paths. |
802
f51305056196
Added modules related to type rules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
800
diff
changeset
|
35 /// |
839
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
36 /// Macro definitions in ddoc_files[n] override the ones in ddoc_files[n-1].$(BR) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
37 /// Relative paths are resolved from the current working directory. |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
38 var DDOC_FILES = ["${DATADIR}/predefined.ddoc"]; /// E.g.: ["src/mymacros.ddoc", "othermacros.ddoc"] |
758
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
39 |
839
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
40 /// Path to the language file. |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
41 var LANG_FILE = "${DATADIR}/lang_en.d"; |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
42 /// Path to the xml map. |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
43 var XML_MAP = "${DATADIR}/xml_map.d"; |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
44 /// Path to the html map. |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
45 var HTML_MAP = "${DATADIR}/html_map.d"; |
759
9c47f377ca0b
Revised module cmd.Generate.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
758
diff
changeset
|
46 |
758
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
47 /// Customizable formats for error messages. |
f4b9680c0e16
Revised module dil.SettingsLoader.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
721
diff
changeset
|
48 /// |
839
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
49 /// $(UL |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
50 /// $(LI 0: file path to the source text.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
51 /// $(LI 1: line number.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
52 /// $(LI 2: column number.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
53 /// $(LI 3: error message.) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
54 /// ) |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
55 var LEXER_ERROR = "{0}({1},{2})L: {3}"; |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
56 var PARSER_ERROR = "{0}({1},{2})P: {3}"; /// ditto |
4063da6f3edd
Refactored the config file and how it is loaded.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
57 var SEMANTIC_ERROR = "{0}({1},{2})S: {3}"; /// ditto |