Files
lix/tests
Eelco Dolstra 6d6c68c0d2 * Added a new kind of multi-line string literal delimited by two
single quotes.  Example (from NixOS):

    job = ''
      start on network-interfaces

      start script

        rm -f /var/run/opengl-driver
        ${if videoDriver == "nvidia"        
          then "ln -sf ${nvidiaDrivers} /var/run/opengl-driver"
          else if cfg.driSupport
          then "ln -sf ${mesa} /var/run/opengl-driver"
          else ""
        }

        rm -f /var/log/slim.log

      end script
    '';

  This style has two big advantages:

  - \, ' and " aren't special, only '' and ${.  So you get a lot less
    escaping in shell scripts / configuration files in Nixpkgs/NixOS.
    The delimiter '' is rare in scripts (and can usually be written as
    "").  ${ is also fairly rare.

    Other delimiters such as <<...>>, {{...}} and <|...|> were also
    considered but this one appears to have the fewest drawbacks
    (thanks Martin).

  - Indentation is intelligently stripped so that multi-line strings
    can follow the nesting structure of the containing Nix
    expression.  E.g. in the example above 6 spaces are stripped from
    the start of each line.  This prevents unnecessary indentation in
    generated files (which sometimes even breaks things).

  See tests/lang/eval-okay-ind-string.nix for some examples.
2007-11-30 16:48:45 +00:00
..
2006-03-01 16:52:55 +00:00
2006-07-21 13:21:43 +00:00
2006-03-01 12:51:18 +00:00
2006-03-01 13:25:08 +00:00
2006-07-21 13:21:43 +00:00
2007-08-13 13:15:02 +00:00
2007-01-29 14:23:09 +00:00
2007-01-29 14:23:09 +00:00
2007-09-11 13:32:04 +00:00
2007-09-11 13:32:04 +00:00
2006-07-21 13:21:43 +00:00
2006-07-21 13:21:43 +00:00
2006-03-01 13:25:08 +00:00
2007-02-21 14:00:46 +00:00
2006-03-01 14:26:03 +00:00
2006-07-21 13:21:43 +00:00
2006-07-21 13:21:43 +00:00
2006-03-01 12:51:18 +00:00
2006-03-01 16:03:32 +00:00
2007-08-13 14:56:40 +00:00
2006-03-01 12:51:18 +00:00
2006-03-01 14:26:03 +00:00
2006-07-21 13:21:43 +00:00
2006-07-21 13:21:43 +00:00
2006-03-01 12:51:18 +00:00
2007-08-13 13:15:02 +00:00
2006-07-21 13:21:43 +00:00
2006-07-21 13:21:43 +00:00
2007-08-13 13:15:02 +00:00
2007-08-13 13:15:02 +00:00
2007-08-13 13:15:02 +00:00
2007-08-13 13:15:02 +00:00
2006-07-21 13:21:43 +00:00
2006-07-21 13:21:43 +00:00
2006-03-01 12:51:18 +00:00