Skip to content

Commit

Permalink
Merge pull request #14 from GnicoJP/master
Browse files Browse the repository at this point in the history
fix CR + LF merging. Basic tokens will disappear after CRLF. CRLFの直後にBasicトークンが来るとそのBasicトークンが消えるバグの修正.
  • Loading branch information
puripuri2100 authored Jan 1, 2025
2 parents 8dc3eda + 5490a99 commit 880063c
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 880063c

Please sign in to comment.