Skip to content

Commit 8886ebe

Browse files
Tab hack
1 parent 664d5ac commit 8886ebe

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.drom

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lsp/cobol_parser/dune

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lsp/cobol_parser/package.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ dune-trailer = """
8686
(menhir (modules grammar_tokens grammar_common grammar)
8787
(merge_into grammar)
8888
(flags --inspection --cmly --table --strict
89-
89+
--explain
9090
--external-tokens Grammar_tokens
9191
--unused-tokens))
9292

src/lsp/cobol_preproc/src_lexer.mll

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,23 @@
171171

172172
}
173173

174+
let tab = '\t'
174175
let newline = '\r'* '\n'
175176
let nnl = _ # ['\r' '\n'] (* anything but newline *)
176177
let sna = nnl nnl nnl nnl nnl nnl (* 6 chars; TODO: exclude tabs *)
178+
let tabs =
179+
(tab |
180+
nnl tab |
181+
nnl nnl tab |
182+
nnl nnl nnl tab |
183+
nnl nnl nnl nnl tab |
184+
nnl nnl nnl nnl nnl tab |
185+
nnl nnl nnl nnl nnl nnl tab |
186+
nnl nnl nnl nnl nnl nnl nnl tab)
177187
let spaces = ([' ' '\t']*)
178188
let blank = [' ' '\009' '\r']
179189
let nonblank = nnl # blank
180-
let blanks =(blank+ | '\t')
190+
let blanks =(blank | '\t')+
181191
let blank_area_A = blank blank blank blanks | '\t'
182192
let nonblank_area_A =(nonblank nnl nnl nnl |
183193
blank nonblank nnl nnl |
@@ -252,7 +262,7 @@ rule fixed_line state
252262
{
253263
fixed_indicator (Src_lexing.sna state lexbuf) lexbuf
254264
}
255-
| '\t'
265+
| tabs
256266
{
257267
fixed_nominal_line (Src_lexing.flush_continued state) lexbuf
258268
}

0 commit comments

Comments
 (0)