Mercurial > projects > dil
annotate trunk/src/lang_en.d @ 390:4d36eea1bbc9
Refactored Lexer.scan().
Illegal characters are not ignored anymore. They are reported as errors.
Added a new member 'ws' to Token. When a token is scanned the lexer sets
ws to the leading whitespace or leaves it at null when no whitespace was found.
Added Illegal to enum TOK and IllegalCharacter to enum MID.
Added localized messages for MID.IllegalCharacter.
Adapted code of cmd.Generate to make use of Token.ws.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Wed, 12 Sep 2007 21:03:41 +0200 |
parents | c4bfceab7246 |
children | 33b566df6af4 |
rev | line source |
---|---|
309 | 1 /++ |
2 Author: Aziz Köksal | |
3 License: GPL3 | |
4 +/ | |
5 | |
349 | 6 string lang_code = "en"; |
7 | |
309 | 8 string[] messages = [ |
310 | 9 // Lexer messages: |
390
4d36eea1bbc9
Refactored Lexer.scan().
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
389
diff
changeset
|
10 "illegal character found: '{1}'", |
309 | 11 "invalid Unicode character.", |
12 "invalid UTF-8 sequence.", | |
13 // '' | |
14 "unterminated character literal.", | |
15 "empty character literal.", | |
16 // #line | |
17 "expected 'line' after '#'.", | |
18 "integer expected after #line", | |
323 | 19 `expected filespec string (e.g. "path\to\file".)`, |
20 "unterminated filespec string.", | |
309 | 21 "expected a terminating newline after special token.", |
22 // "" | |
23 "unterminated string literal.", | |
24 // x"" | |
25 "non-hex character '{1}' found in hex string.", | |
26 "odd number of hex digits in hex string.", | |
27 "unterminated hex string.", | |
28 // /* */ /+ +/ | |
29 "unterminated block comment (/* */).", | |
30 "unterminated nested comment (/+ +/).", | |
31 // `` r"" | |
32 "unterminated raw string.", | |
33 "unterminated back quote string.", | |
34 // \x \u \U | |
387
ad0cbd1c8881
Undefined escape sequences are passed to error() now.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
375
diff
changeset
|
35 "found undefined escape sequence '{1}'.", |
309 | 36 "insufficient number of hex digits in escape sequence.", |
37 // \&[a-zA-Z][a-zA-Z0-9]+; | |
38 "undefined HTML entity '{1}'", | |
39 "unterminated HTML entity.", | |
310 | 40 "HTML entities must begin with a letter.", |
309 | 41 // integer overflows |
42 "decimal number overflows sign bit.", | |
43 "overflow in decimal number.", | |
44 "overflow in hexadecimal number.", | |
45 "overflow in binary number.", | |
46 "overflow in octal number.", | |
47 "overflow in float number.", | |
48 "digits 8 and 9 are not allowed in octal numbers.", | |
49 "invalid hex number; at least one hex digit expected.", | |
50 "invalid binary number; at least one binary digit expected.", | |
51 "the exponent of a hexadecimal float number is required.", | |
389
c4bfceab7246
Applied fixes and improvements to hex float scanner.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
387
diff
changeset
|
52 "hexadecimal float exponents must start with a digit.", |
c4bfceab7246
Applied fixes and improvements to hex float scanner.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
387
diff
changeset
|
53 "exponents must start with a digit.", |
309 | 54 |
55 // Parser messages | |
56 "expected '{1}', but found '{2}'.", | |
57 "'{1}' is redundant.", | |
341
3ac651ea83fb
- Fix: created TemplateAliasParameter instead of TemplateTypeParameter.
aziz
parents:
338
diff
changeset
|
58 "template tuple parameters can only be last.", |
342
f13d551d7c4f
- Added error messages MID.InContract and MID.OutContract.
aziz
parents:
341
diff
changeset
|
59 "the functions 'in' contract was already parsed.", |
f13d551d7c4f
- Added error messages MID.InContract and MID.OutContract.
aziz
parents:
341
diff
changeset
|
60 "the functions 'out' contract was already parsed.", |
359
511c14950cac
- Added messages MissingLinkageType and UnrecognizedLinkageType.
aziz
parents:
349
diff
changeset
|
61 "no linkage type was specified.", |
511c14950cac
- Added messages MissingLinkageType and UnrecognizedLinkageType.
aziz
parents:
349
diff
changeset
|
62 "unrecognized linkage type '{1}'; valid types are C, C++, D, Windows, Pascal und System.", |
309 | 63 |
310 | 64 // Help messages: |
309 | 65 `dil v{1} |
310 | 66 Copyright (c) 2007 by Aziz Köksal. Licensed under the GPL3. |
309 | 67 |
68 Subcommands: | |
338 | 69 {2} |
309 | 70 Type 'dil help <subcommand>' for more help on a particular subcommand. |
71 | |
338 | 72 Compiled with {3} v{4} on {5}.`, |
375
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
73 |
329 | 74 `Generate an XML or HTML document from a D source file. |
75 Usage: | |
76 dil gen file.d [Options] | |
77 | |
78 Options: | |
338 | 79 --syntax : generate tags for the syntax tree |
80 --xml : use XML format (default) | |
329 | 81 --html : use HTML format |
82 | |
83 Example: | |
338 | 84 dil gen Parser.d --html --syntax > Parser.html`, |
375
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
85 |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
86 `Parse a module and extract information from the resulting module dependency graph. |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
87 Usage: |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
88 dil igraph file.d Format [Options] |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
89 |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
90 The directory of file.d is implicitly added to the list of import paths. |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
91 |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
92 Format: |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
93 --dot : generate a dot document |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
94 -gbp : Group modules by package names |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
95 -gbf : Group modules by full package name |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
96 -hle : highlight cyclic edges in the graph |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
97 -hlv : highlight modules in cyclic relationship |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
98 |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
99 --paths : print a list of paths to the modules imported by file.d |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
100 -lN : print N levels. |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
101 |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
102 --list : print a list of the module names imported by file.d |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
103 -lN : print N levels. |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
104 |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
105 Options: |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
106 -Ipath : add 'path' to the list of import paths where modules are |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
107 looked for |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
108 -rREGEXP : exclude modules whose names match the regular expression |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
109 REGEXP |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
110 -i : include unlocatable modules |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
111 |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
112 Example: |
0bd21b746a04
- Added code to main() for recognizing options to the importgraph command.
aziz
parents:
359
diff
changeset
|
113 dil igraph src/main.d`, |
309 | 114 ]; |