Skip to content

Commit 4d4cb3b

Browse files
committed
syncweb -loc, skip lines with just spaces
1 parent d35ea16 commit 4d4cb3b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎frontend/Stat.ml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ let stat_of_web (orig : Web.t) : t =
3030
(* TEX *)
3131
match s with
3232
| "" -> ()
33+
| s when s =~ "^[ \t]*$" -> ()
3334
| s when s =~ "^%.*" -> ()
35+
(* I keep \n (for notes) as legic LOE for now *)
3436
| s when s =~ "^\\\\[tl] " -> ()
3537
(* for now I consider Tex commands \xxx as legit explanations as
3638
* they can be section names for example which usually help to
@@ -47,6 +49,7 @@ let stat_of_web (orig : Web.t) : t =
4749
(* CODE *)
4850
(match s with
4951
| "" -> ()
52+
| s when s =~ "^[ \t]*$" -> ()
5053
(* LATER? look if only space line? *)
5154
| _ ->
5255
Logs.debug (fun m -> m "LOC: %s" s);

‎tests/loc/foo.nw‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
\maketitle
99
\chapter{First chapter}
1010

11+
This should count
12+
1113
% this should not count
1214
\l neither this
1315
\t or this
1416

17+
% also this next line has multiple spaces and tabs which again should not count
18+
19+
1520
\section{First section}
1621

1722
This is some example
@@ -29,6 +34,7 @@ int main(int argc, char** argv)
2934

3035
<<say hello>>=
3136
printf("Hello World!\n");
37+
3238
@
3339

3440
<<includes>>=

0 commit comments

Comments
 (0)