Differences From Artifact [fb4085e84f38ed6a]:
- File
polemy/lex.d
- 2010-11-07 10:32:59 - part of checkin [4198578702e] on branch trunk - Changed several documentation comments into ddoc compatible ones. (user: kinaba) [annotate]
To Artifact [e43d60d2bdfc662b]:
- File
polemy/lex.d
- 2010-11-07 15:03:38 - part of checkin [820e7198cc] on branch trunk - Made helloworld work. (user: kinaba) [annotate]
44 assert( !__traits(compiles, p.column =222) ); 44 assert( !__traits(compiles, p.column =222) );
45 } 45 }
46 46
47 /// Represents a lexer token 47 /// Represents a lexer token
48 48
49 class Token 49 class Token
50 { 50 {
> 51 /// currently we have three kinds of token
51 enum Kind {identifier, stringLiteral, number}; | 52 enum Kind {
> 53 identifier, /// anything other than others
> 54 stringLiteral, /// "string literal"
> 55 number /// 42
> 56 };
52 immutable LexPosition pos; /// position where the token occurred in the 57 immutable LexPosition pos; /// position where the token occurred in the
53 immutable string str; /// the token string itself 58 immutable string str; /// the token string itself
54 immutable Kind kind; /// which kind of token? 59 immutable Kind kind; /// which kind of token?
55 60
56 mixin SimpleConstructor; 61 mixin SimpleConstructor;
57 mixin SimpleCompare; 62 mixin SimpleCompare;
58 } 63 }