Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002408graphvizDocumentationpublic2014-01-05 15:262014-01-06 16:18
Assigned Toerg 
PlatformLinuxOSDebianOS Version3.2.51-1 x86_64
Summary0002408: Docs claim a trailing backslash "escapes" a newline so that a logical line can span multiple physical lines. It doesn't.
DescriptionThe page at [^] contains the paragraph:

    As another aid for readability, dot allows single logical lines to span multiple physical lines using the standard C convention of a backslash immediately preceding a newline character. In addition, double-quoted strings can be concatenated using a '+' operator. As HTML strings can contain newline characters, they do not support the concatenation operator.

The string-concatenation operator works, but it doesn't seem like the backslash part is working properly.
Steps To ReproduceThe following one-liner will reproduce the problem:

  echo -e "graph G { A --\\\\\n B }" | dot

which yields:

  Warning: <stdin>: syntax error in line 1 near '\'

More readably, note that while the DOT file:

  graph G {
    A -- B
    n [label="foo" shape=box]

works as expected, the DOT file:

  graph G {
    A -- \
    n [label="foo" \

yields an error, even though they are identical (modulo whitespace) if the trailing backslash works as described.

Additional InformationHere's the output I get from `dot -v`:

dot - graphviz version 2.35.20131110.0545 (20131110.0545)
libdir = "/usr/lib/graphviz"
Activated plugin library:
Using layout: dot:dot_layout
Activated plugin library:
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
        was successfully loaded.
    render : cairo dot fig gd map pic pov ps svg tk vml vrml xdot
    layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout : textlayout
    device : bmp canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gtk gv ico imap imap_np ismap jpe jpeg jpg pdf pic plain plain-ext png pov ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp x11 xdot xdot1.2 xdot1.4 xlib
    loadimage : (lib) bmp eps gd gd2 gif ico jpe jpeg jpg png ps svg
TagsNo tags attached.
VERSION2.35.20131110.0545 (20131110.0545)
Attached Files

- Relationships

-  Notes
User avatar (0000661)
rodw. (reporter)
2014-01-05 15:28

PS: I forgot to mention, the cryptic one-liner in the "steps to reproduce" section does generate the file we're looking for.

  $ echo -e "graph G { A --\\\\\n B }"
  graph G { A --\
   B }

  $ echo -e "graph G { A --\\\\\n B }" | dot
  Warning: <stdin>: syntax error in line 1 near '\'
User avatar (0000662)
erg (administrator)
2014-01-06 16:18

This worked with the old graph library. The cgraph library uses flex, which makes this feature almost impossible to provide except between tokens, where it serves little purpose. It could be implemented at a lower level using additional buffering and scanning (which is how the graph library dealt with it) but the general feature would only be useful if someone where using enormous IDs. Given this, we have amended the language definition to only require this feature for double-quoted strings, where it can actually be useful.

- Issue History
Date Modified Username Field Change
2014-01-05 15:26 rodw. New Issue
2014-01-05 15:28 rodw. Note Added: 0000661
2014-01-06 16:18 erg Note Added: 0000662
2014-01-06 16:18 erg Assigned To => erg
2014-01-06 16:18 erg Status new => closed
2014-01-06 16:18 erg Resolution open => fixed

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker