From 6bd6ed58860e7713fdf4aaaad2dabff204ae6646 Mon Sep 17 00:00:00 2001 From: filliatr Date: Thu, 4 Apr 2002 15:54:46 +0000 Subject: meilleure gestion du point terminal git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2611 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tools/gallina_lexer.mll | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'tools/gallina_lexer.mll') diff --git a/tools/gallina_lexer.mll b/tools/gallina_lexer.mll index 98c838ed7..4d05688c3 100644 --- a/tools/gallina_lexer.mll +++ b/tools/gallina_lexer.mll @@ -23,6 +23,7 @@ } let space = [' ' '\t' '\n'] +let enddot = '.' (' ' | '\t' | '\n' | eof) rule action = parse | "Theorem" space { print "Theorem "; body lexbuf; @@ -78,26 +79,27 @@ and body_def = parse | _ { print (Lexing.lexeme lexbuf); body lexbuf } and body = parse - | '.' { print ".\n"; skip_proof lexbuf } - | ":=" { print ".\n"; skip_proof lexbuf } - | "(*" { print "(*"; comment_depth := 1; - comment lexbuf; body lexbuf } - | eof { raise Fin_fichier } - | _ { print (Lexing.lexeme lexbuf); body lexbuf } + | enddot { print ".\n"; skip_proof lexbuf } + | ":=" { print ".\n"; skip_proof lexbuf } + | "(*" { print "(*"; comment_depth := 1; + comment lexbuf; body lexbuf } + | eof { raise Fin_fichier } + | _ { print (Lexing.lexeme lexbuf); body lexbuf } and body_pgm = parse - | '.' { print ".\n"; skip_proof lexbuf } - | "(*" { print "(*"; comment_depth := 1; - comment lexbuf; body_pgm lexbuf } - | eof { raise Fin_fichier } - | _ { print (Lexing.lexeme lexbuf); body_pgm lexbuf } + | enddot { print ".\n"; skip_proof lexbuf } + | "(*" { print "(*"; comment_depth := 1; + comment lexbuf; body_pgm lexbuf } + | eof { raise Fin_fichier } + | _ { print (Lexing.lexeme lexbuf); body_pgm lexbuf } and skip_until_point = parse - | '.' { end_of_line lexbuf } - | "(*" { comment_depth := 1; - skip_comment lexbuf; skip_until_point lexbuf } - | eof { raise Fin_fichier } - | _ { skip_until_point lexbuf } + | '.' '\n' { () } + | enddot { end_of_line lexbuf } + | "(*" { comment_depth := 1; + skip_comment lexbuf; skip_until_point lexbuf } + | eof { raise Fin_fichier } + | _ { skip_until_point lexbuf } and end_of_line = parse | [' ' '\t' ]* { end_of_line lexbuf } @@ -119,7 +121,7 @@ and skip_proof = parse | "Abort" space { skip_until_point lexbuf } | "Proof" space { skip_until_point lexbuf } - | "Proof" [' ' '\t' ]* '.' { skip_proof lexbuf } + | "Proof" [' ' '\t']* '.' { skip_proof lexbuf } | "(*" { comment_depth := 1; skip_comment lexbuf; skip_proof lexbuf } | eof { raise Fin_fichier } -- cgit v1.2.3