DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B0002: unterminated string literal

Catalog status: active. Default severity: error. Stable name: unterminated-string. Family: Syntax and source text.

A string literal must end on the line where it starts. This one reaches the end of the line without its closing ". When the line ends in punctuation such as );, Verada assumes the quote belongs before it and suggests that.

Example (Vada)

   Put_Line ("Hello, world);

Example (Varc)

    Put_Line("Hello, world);

What to do (Vada)

Add the closing quote. To build a long string across lines, close it on each line and join the pieces with &. Write a quote inside a string by doubling it: "say ""hi""".

What to do (Varc)

Add the closing quote. To build a long string across lines, close it on each line and join the pieces with ++. Write a quote inside a string with an escape: "say \"hi\"".

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.