Skip to content

Commit

Permalink
fix CR + LF merging. Basic tokens will disappear after CRLF.
Browse files Browse the repository at this point in the history
  • Loading branch information
GnicoJP committed Dec 31, 2024
1 parent 8dc3eda commit 5490a99
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/code-printer.satyh
Original file line number Diff line number Diff line change
Expand Up @@ -711,17 +711,20 @@ end = struct
else
List.reverse-append xs token-lst
)
| x::y::zs when (is-LF x && is-CR y) -> organize (CRLF::token-lst) false null-string zs
| x::ys -> (
match x with
| Basic(s) -> organize token-lst true (s^basic-str) ys
| _ -> (
%%% トークンを分割
let xs = split-token-of-line x in
if is-basic then
organize (List.reverse-append xs ((Basic(basic-str))::token-lst)) false null-string ys
else
organize (List.reverse-append xs token-lst) false null-string ys
let token-lst2 =
if is-basic then ((Basic(basic-str))::token-lst) else token-lst
in
match ys with
| y::zs when (is-LF x && is-CR y) -> (organize (CRLF::token-lst2) false null-string zs)
| _ -> (
%%% トークンを分割
let xs = split-token-of-line x in
organize (List.reverse-append xs token-lst2) false null-string ys
)
)
)
in
Expand Down

0 comments on commit 5490a99

Please sign in to comment.