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
Closed

ocamllex warning: unescaped newline in comment string #6526

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

Comments

@vicuna
Copy link

vicuna 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
Copy link
Author

vicuna 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
Copy link
Author

vicuna commented Jan 16, 2015

Comment author: @damiendoligez

Fixed in trunk (rev 15780).

@vicuna vicuna closed this as completed 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
Projects
None yet
Development

No branches or pull requests

1 participant