- method eos =
- let rec is_there_only_comments status s =
- if Pcre.pmatch ~rex:only_dust_RE s then raise Margin;
- let strm =
- GrafiteParser.parsable_statement status
- (Ulexing.from_utf8_string s)in
- match GrafiteParser.parse_statement status strm with
- | GrafiteAst.Comment (loc,_) ->
- let _,parsed_text_length = MatitaGtkMisc.utf8_parsed_text s loc in
- (* CSC: why +1 in the following lines ???? *)
- let parsed_text_length = parsed_text_length + 1 in
- let remain_len = String.length s - parsed_text_length in
- let next = String.sub s parsed_text_length remain_len in
- is_there_only_comments status next
- | GrafiteAst.Executable _ -> false
- in
- try is_there_only_comments self#status self#getFuture
- with
- | NCicLibrary.IncludedFileNotCompiled _
- | HExtlib.Localized _
- | CicNotationParser.Parse_error _ -> false
- | Margin | End_of_file -> true
- | Invalid_argument "Array.make" -> false