Skip to content

Commit

Permalink
Sanity checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlepigre committed Sep 28, 2020
1 parent 665fb9c commit aed60dd
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 94 deletions.
8 changes: 4 additions & 4 deletions lib/charset.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
way of building parsers using an extention of OCaml's syntax.
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. You can use,
abiding by the rules of distribution of free software. You can use,
modify and/or redistribute the software under the terms of the CeCILL-
B license as circulated by CEA, CNRS and INRIA at the following URL.
http://www.cecill.info
http://www.cecill.info
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided
only with a limited warranty and the software's author, the holder of
the economic rights, and the successive licensors have only limited
liability.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
Expand All @@ -33,7 +33,7 @@
encouraged to load and test the software's suitability as regards
their requirements in conditions enabling the security of their sys-
tems and/or data to be ensured and, more generally, to use and operate
it in the same conditions as regards security.
it in the same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-B license and that you accept its terms.
Expand Down
8 changes: 4 additions & 4 deletions lib/charset.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
way of building parsers using an extention of OCaml's syntax.
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. You can use,
abiding by the rules of distribution of free software. You can use,
modify and/or redistribute the software under the terms of the CeCILL-
B license as circulated by CEA, CNRS and INRIA at the following URL.
http://www.cecill.info
http://www.cecill.info
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided
only with a limited warranty and the software's author, the holder of
the economic rights, and the successive licensors have only limited
liability.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
Expand All @@ -33,7 +33,7 @@
encouraged to load and test the software's suitability as regards
their requirements in conditions enabling the security of their sys-
tems and/or data to be ensured and, more generally, to use and operate
it in the same conditions as regards security.
it in the same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-B license and that you accept its terms.
Expand Down
10 changes: 5 additions & 5 deletions lib/earley_str.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
way of building parsers using an extention of OCaml's syntax.
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. You can use,
abiding by the rules of distribution of free software. You can use,
modify and/or redistribute the software under the terms of the CeCILL-
B license as circulated by CEA, CNRS and INRIA at the following URL.
http://www.cecill.info
http://www.cecill.info
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided
only with a limited warranty and the software's author, the holder of
the economic rights, and the successive licensors have only limited
liability.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
Expand All @@ -33,7 +33,7 @@
encouraged to load and test the software's suitability as regards
their requirements in conditions enabling the security of their sys-
tems and/or data to be ensured and, more generally, to use and operate
it in the same conditions as regards security.
it in the same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-B license and that you accept its terms.
Expand All @@ -45,7 +45,7 @@
open Earley_core.Input
open Earley_core.Earley

(** [blank_regexp re] produces a blank function from the regexp [re]
(** [blank_regexp re] produces a blank function from the regexp [re]
(following the [Str] syntax). There is an important limitation rega-
rding regular expressions containing the newline character ['\n'],
due to the fact that the [Str] module only matches on strings (and
Expand Down
4 changes: 2 additions & 2 deletions lib/internals.ml
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ let pred_prod_lec : type a. errpos -> a final -> a cur -> a reads
try let res = Ref.find tmemo memo in
res (* Check if this was done *)
with Not_found ->
let rules = List.filter (good c) rules in
Ref.add tmemo memo rules;
let rules = List.filter (good c) rules in
Ref.add tmemo memo rules;
List.iter
(fun rule ->
let start = cur_pos in
Expand Down
8 changes: 4 additions & 4 deletions lib/regexp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
way of building parsers using an extention of OCaml's syntax.
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. You can use,
abiding by the rules of distribution of free software. You can use,
modify and/or redistribute the software under the terms of the CeCILL-
B license as circulated by CEA, CNRS and INRIA at the following URL.
http://www.cecill.info
http://www.cecill.info
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided
only with a limited warranty and the software's author, the holder of
the economic rights, and the successive licensors have only limited
liability.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
Expand All @@ -33,7 +33,7 @@
encouraged to load and test the software's suitability as regards
their requirements in conditions enabling the security of their sys-
tems and/or data to be ensured and, more generally, to use and operate
it in the same conditions as regards security.
it in the same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-B license and that you accept its terms.
Expand Down
8 changes: 4 additions & 4 deletions lib/regexp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
way of building parsers using an extention of OCaml's syntax.
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. You can use,
abiding by the rules of distribution of free software. You can use,
modify and/or redistribute the software under the terms of the CeCILL-
B license as circulated by CEA, CNRS and INRIA at the following URL.
http://www.cecill.info
http://www.cecill.info
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided
only with a limited warranty and the software's author, the holder of
the economic rights, and the successive licensors have only limited
liability.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
Expand All @@ -33,7 +33,7 @@
encouraged to load and test the software's suitability as regards
their requirements in conditions enabling the security of their sys-
tems and/or data to be ensured and, more generally, to use and operate
it in the same conditions as regards security.
it in the same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-B license and that you accept its terms.
Expand Down
4 changes: 2 additions & 2 deletions pa_ocaml/pa_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ let rec merge = function
| [loc] -> loc
| l2::ls when Location.(l2.loc_start = l2.loc_end) -> fn ls
| l2::ls ->
Location.(
{loc_start = l1.loc_start; loc_end = l2.loc_end; loc_ghost = l1.loc_ghost && l2.loc_ghost})
Location.(
{loc_start = l1.loc_start; loc_end = l2.loc_end; loc_ghost = l1.loc_ghost && l2.loc_ghost})
in fn ls

let merge2 l1 l2 =
Expand Down
26 changes: 13 additions & 13 deletions pa_ocaml/pa_lexing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ let ocaml_blank buf pos =
| (`Ini , [] , _ ) -> curr
| (`Opn(p) , _ , '*' ) ->
(if stack = [] then
let (c, buf', pos') = Input.read buf' pos' in
let (c',_,_) = Input.read buf' pos' in
if c = '*' && c' <> '*' then (
ocamldoc := true;
fn `Cls (p::stack) curr (buf',pos'))
else
fn `Ini (p::stack) curr next
else
fn `Ini (p::stack) curr next)
let (c, buf', pos') = Input.read buf' pos' in
let (c',_,_) = Input.read buf' pos' in
if c = '*' && c' <> '*' then (
ocamldoc := true;
fn `Cls (p::stack) curr (buf',pos'))
else
fn `Ini (p::stack) curr next
else
fn `Ini (p::stack) curr next)
| (`Opn(_) , _::_, '"' ) -> fn (`Str(curr)) stack curr next (*#*)
| (`Opn(_) , _::_, '{' ) -> fn (`SOp([],curr)) stack curr next (*#*)
| (`Opn(_) , _::_, '(' ) -> fn (`Opn(curr)) stack curr next
Expand Down Expand Up @@ -166,13 +166,13 @@ let ocaml_blank buf pos =
| (`Cls , _::_, '{' ) -> fn (`SOp([],curr)) stack curr next (*#*)
| (`Cls , p::s, ')' ) ->
if !ocamldoc && s = [] then (
let comment =
let comment =
try Buffer.sub ocamldoc_buf 0 (Buffer.length ocamldoc_buf - 2)
with Invalid_argument _ -> ""
in
Buffer.clear ocamldoc_buf;
ocamldoc_comments := (p,next,comment,!previous_newline)::!ocamldoc_comments;
ocamldoc := false
Buffer.clear ocamldoc_buf;
ocamldoc_comments := (p,next,comment,!previous_newline)::!ocamldoc_comments;
ocamldoc := false
);
new_line := false;
fn `Ini s curr next
Expand Down
Loading

0 comments on commit aed60dd

Please sign in to comment.