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

ocamllex warning: unescaped newline in comment string #6526

Closed
vicuna opened this issue Aug 29, 2014 · 2 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Aug 29, 2014

Original bug ID: 6526
Reporter: dhekir
Status: closed (set by @damiendoligez on 2015-01-16T23:05:38Z)
Resolution: fixed
Priority: low
Severity: trivial
Version: 4.02.0+beta1 / +rc1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: tools (ocaml{lex,yacc,dep,debug,...})

Bug description

Non-terminated double quotes cause ocamllex to emit a warning even when they happen within comments:

(*

  • THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  • IS" AND ANY EXPRESS OR IMPLIED WARRANTIES ETC ETC ETC.
    *)
    rule translate = parse
    | eof { exit 0 }

ocamllex warning:
File "test.mll", line 2, character 75: unescaped newline in string.

This behavior might bother some purists, but it's not clear whether it should be considered a bug.

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 30, 2014

Comment author: @gasche

Would you like to provide a patch for this issue? You should be able to fix it in lex/lexer.mll (not parsing/lexer.mll, this is an error about the parsing of .mll files rather than general OCaml files), maybe checking comment_depth to know whether you are in a comment.

@vicuna

This comment has been minimized.

Copy link
Author

commented Jan 16, 2015

Comment author: @damiendoligez

Fixed in trunk (rev 15780).

@vicuna vicuna closed this Jan 16, 2015

@vicuna vicuna added the tools label Mar 14, 2019

@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.