~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to otherlibs/labltk/compiler/lexer.mll

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
(*                                                                     *)
15
15
(***********************************************************************)
16
16
 
17
 
(* $Id: lexer.mll 5029 2002-07-23 14:12:03Z doligez $ *)
 
17
(* $Id: lexer.mll 9547 2010-01-22 12:48:24Z doligez $ *)
18
18
 
19
19
{
20
20
open StdLabels
40
40
  "string", TYSTRING;
41
41
  "list", LIST;
42
42
  "as", AS;
43
 
  "variant", VARIANT;  
 
43
  "variant", VARIANT;
44
44
  "widget", WIDGET;
45
45
  "option", OPTION;
46
46
  "type", TYPE;
127
127
  | "?" {QUESTION}
128
128
  | "/" {SLASH}
129
129
  | "%" { comment lexbuf; main lexbuf }
130
 
  | "##line" { line lexbuf; main lexbuf }  
 
130
  | "##line" { line lexbuf; main lexbuf }
131
131
  | eof { EOF }
132
132
  | _
133
133
      { raise (Lexical_error("illegal character")) }
134
134
 
135
 
 
 
135
 
136
136
and string = parse
137
137
    '"'
138
138
      { () }
160
160
 | _ { comment lexbuf }
161
161
 
162
162
and linenum = parse
163
 
 | ['0'-'9']+ { 
 
163
 | ['0'-'9']+ {
164
164
            let next_line = int_of_string (Lexing.lexeme lexbuf) in
165
165
            current_line := next_line - 1
166
166
          }