Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I preserve the original newline character(whether Newline or Carriage Return) when no rules are applied? #319

Open
sangwoo-joh opened this issue Oct 12, 2021 · 0 comments

Comments

@sangwoo-joh
Copy link

For example, for the below code where ^M as carriage return,

def foo(a: str,^M
            b: str):^M
   ...

And I have a rule for rewriting the wrongly typed string to str as follow:

match="def :[fun](:[args])"
rewrite="def :[fun](:[args])"
rule='where rewrite :[exp] { ":[var]: string" -> ":[var]: str" }'

Since there is no violation in the above code, I didn't expect any modifications to be made. However, after I ran the rule, I found that the original ^Ms were disappeared:

def foo(a: str,
            b: str):
   ...

How can I preserve the original newline character?

@sangwoo-joh sangwoo-joh changed the title How can I preserve the original newline(whether Newline or Carriage Return) when no rules are applied? How can I preserve the original newline character(whether Newline or Carriage Return) when no rules are applied? Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant