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

handle multi-line strings and comments #1

Open
sloganking opened this issue Mar 26, 2022 · 5 comments
Open

handle multi-line strings and comments #1

sloganking opened this issue Mar 26, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@sloganking
Copy link
Owner

let test = 
"
//>
    Hello World!
//<
"

The //> and //< in the above multi-line string will currently be treated as structured comments. This should not happen.

@sloganking sloganking added the bug Something isn't working label Mar 26, 2022
@sloganking
Copy link
Owner Author

To find all comments in code, using a scanner

  • Have scanner create vector of tokens.
  • .filter() out all tokens of non comment type.
  • Pray the comment tokens contain line number.

@sloganking
Copy link
Owner Author

It appears syntect could be (ab)used to support this. It divides lines into tokens based on their syntax. These tokens are formed in a way that can distinguish between what's a string and what's an actual comment. However it's not ideal.

@sloganking
Copy link
Owner Author

This is preventing the creation of tests. Though I guess I could create tests of runs on a language that didn't have // comment starters like rust.

@sloganking
Copy link
Owner Author

This issue also causes multi-line comments to have the same problem.

@sloganking
Copy link
Owner Author

This is preventing the creation of tests. Though I guess I could create tests of runs on a language that didn't have // comment starters like rust.

Affected tests are being done from loading strings to tests from files

@sloganking sloganking changed the title handle multi-line strings handle multi-line strings and comments Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant