Mercurial > projects > dil
comparison 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 |
comparison
equal
deleted
inserted
replaced
838:1ecf05e680ba | 839:4063da6f3edd |
---|---|
1 /// The configuration file of dil. | 1 /// The configuration file of dil. |
2 /// | 2 /// |
3 /// Relative paths are resolved from the directory of the executable. | 3 /// The file is searched for in the following order: |
4 /// $(OL | |
5 /// $(LI The environment variable DILCONF.) | |
6 /// $(LI The current working directory.) | |
7 /// $(LI The directory set in the environment variable HOME.) | |
8 /// $(LI The executable's directory.) | |
9 /// ) | |
10 /// The program will fail with an error msg if the file couldn't be found.$(BR) | |
11 /// | |
12 /// The following variables are expanded inside strings (only where paths are expected): | |
13 /// $(UL | |
14 /// $(LI ${DATADIR} -> the data directory of dil (e.g. /home/user/dil/bin/data or C:\dil\bin\data).) | |
15 /// $(LI ${HOME} -> the home directory (e.g. /home/name or C:\Documents and Settings\name).) | |
16 /// $(LI ${EXECDIR} -> the absolute path to the directory of dil's executable (e.g. /home/name/dil/bin).) | |
17 /// ) | |
4 module config; | 18 module config; |
5 | 19 |
20 /// Files needed by dil are located in this directory. | |
21 /// | |
22 /// A relative path is resolved from the directory of dil's executable. | |
23 var DATADIR = "data/"; | |
24 | |
6 /// Predefined version identifiers. | 25 /// Predefined version identifiers. |
7 var version_ids = ["X86", "linux", "LittleEndian"]; | 26 var VERSION_IDS = ["X86", "linux", "LittleEndian"]; |
8 // "X86_64", "Windows", "Win32", "Win64", "BigEndian" | 27 // "X86_64", "Windows", "Win32", "Win64", "BigEndian" |
9 | 28 |
10 /// Path to the language file. | |
11 var langfile = "lang_en.d"; | |
12 | |
13 /// An array of import paths to look for modules. | 29 /// An array of import paths to look for modules. |
14 var import_paths = []; /// E.g.: ["src/", "import/"] | 30 /// |
31 /// Relative paths are resolved from the current working directory. | |
32 var IMPORT_PATHS = []; /// E.g.: ["src/", "import/"] | |
15 | 33 |
16 /// DDoc macro file paths. | 34 /// DDoc macro file paths. |
17 /// | 35 /// |
18 /// Macro definitions in ddoc_files[n] override the ones in ddoc_files[n-1]. | 36 /// Macro definitions in ddoc_files[n] override the ones in ddoc_files[n-1].$(BR) |
19 var ddoc_files = ["predefined.ddoc"]; /// E.g.: ["src/mymacros.ddoc", "othermacros.ddoc"] | 37 /// Relative paths are resolved from the current working directory. |
38 var DDOC_FILES = ["${DATADIR}/predefined.ddoc"]; /// E.g.: ["src/mymacros.ddoc", "othermacros.ddoc"] | |
20 | 39 |
21 var xml_map = "xml_map.d"; | 40 /// Path to the language file. |
22 var html_map = "html_map.d"; | 41 var LANG_FILE = "${DATADIR}/lang_en.d"; |
42 /// Path to the xml map. | |
43 var XML_MAP = "${DATADIR}/xml_map.d"; | |
44 /// Path to the html map. | |
45 var HTML_MAP = "${DATADIR}/html_map.d"; | |
23 | 46 |
24 /// Customizable formats for error messages. | 47 /// Customizable formats for error messages. |
25 /// | 48 /// |
26 /// <ul> | 49 /// $(UL |
27 /// <li>0: file path to the source text.</li> | 50 /// $(LI 0: file path to the source text.) |
28 /// <li>1: line number.</li> | 51 /// $(LI 1: line number.) |
29 /// <li>2: column number.</li> | 52 /// $(LI 2: column number.) |
30 /// <li>3: error message.</li> | 53 /// $(LI 3: error message.) |
31 /// </ul> | 54 /// ) |
32 var lexer_error = "{0}({1},{2})L: {3}"; | 55 var LEXER_ERROR = "{0}({1},{2})L: {3}"; |
33 var parser_error = "{0}({1},{2})P: {3}"; /// ditto | 56 var PARSER_ERROR = "{0}({1},{2})P: {3}"; /// ditto |
34 var semantic_error = "{0}({1},{2})S: {3}"; /// ditto | 57 var SEMANTIC_ERROR = "{0}({1},{2})S: {3}"; /// ditto |