lix/tests/lang
Tuomas Tynkkynen a0e38c16bc libexpr: Recognize newline in more places in lexer
Flex's regexes have an annoying feature: the dot matches everything
except a newline. This causes problems for expressions like:

"${0}\
"

where the backslash-newline combination matches this rule instead of the
intended one mentioned in the comment:

    <STRING>\$|\\|\$\\ {
                    /* This can only occur when we reach EOF, otherwise the above
                    (...|\$[^\{\"\\]|\\.|\$\\.)+ would have triggered.
                    This is technically invalid, but we leave the problem to the
                    parser who fails with exact location. */
                    return STR;
                }
However, the parser actually accepts the resulting token sequence
('"' DOLLAR_CURLY 0 '}' STR '"'), which is a problem because the lexer
rule didn't assign anything to yylval. Ultimately this leads to a crash
when dereferencing a NULL pointer in ExprConcatStrings::bindVars().

The fix does change the syntax of the language in some corner cases
but I think it's only turning previously invalid (or crashing) syntax
to valid syntax. E.g.

"a\
b"

and

''a''\
b''

were previously syntax errors but now both result in "a\nb".

Found by afl-fuzz.
2018-03-02 17:30:48 +02:00
..
dir1
dir2
dir3
dir4
readDir
data Add path primop. 2018-02-06 16:48:08 -05:00
eval-fail-abort.nix
eval-fail-antiquoted-path.nix Add a regression test for correct path antiquotation behavior 2013-10-16 23:29:11 +02:00
eval-fail-assert.nix
eval-fail-bad-antiquote-1.nix
eval-fail-bad-antiquote-2.nix
eval-fail-bad-antiquote-3.nix
eval-fail-blackhole.nix
eval-fail-deepseq.nix
eval-fail-missing-arg.nix
eval-fail-path-slash.nix Update mailing list. 2017-07-18 08:04:01 -04:00
eval-fail-remove.nix
eval-fail-scope-5.nix
eval-fail-seq.nix
eval-fail-substring.nix
eval-fail-to-path.nix
eval-fail-undeclared-arg.nix
eval-okay-any-all.exp
eval-okay-any-all.nix Add primops all and any 2015-07-23 19:23:11 +02:00
eval-okay-arithmetic.exp
eval-okay-arithmetic.nix
eval-okay-attrnames.exp
eval-okay-attrnames.nix
eval-okay-attrs.exp
eval-okay-attrs.nix
eval-okay-attrs2.exp
eval-okay-attrs2.nix
eval-okay-attrs3.exp
eval-okay-attrs3.nix
eval-okay-attrs4.exp
eval-okay-attrs4.nix
eval-okay-attrs5.exp
eval-okay-attrs5.nix
eval-okay-autoargs.exp
eval-okay-autoargs.flags
eval-okay-autoargs.nix
eval-okay-backslash-newline-1.exp libexpr: Recognize newline in more places in lexer 2018-03-02 17:30:48 +02:00
eval-okay-backslash-newline-1.nix libexpr: Recognize newline in more places in lexer 2018-03-02 17:30:48 +02:00
eval-okay-backslash-newline-2.exp libexpr: Recognize newline in more places in lexer 2018-03-02 17:30:48 +02:00
eval-okay-backslash-newline-2.nix libexpr: Recognize newline in more places in lexer 2018-03-02 17:30:48 +02:00
eval-okay-builtins.exp
eval-okay-builtins.nix
eval-okay-callable-attrs.exp
eval-okay-callable-attrs.nix
eval-okay-catattrs.exp
eval-okay-catattrs.nix
eval-okay-closure.exp.xml
eval-okay-closure.nix
eval-okay-comments.exp Fix comments parsing 2016-11-13 17:20:34 +01:00
eval-okay-comments.nix Fix comments parsing 2016-11-13 17:20:34 +01:00
eval-okay-concat.exp
eval-okay-concat.nix
eval-okay-concatstringssep.exp
eval-okay-concatstringssep.nix
eval-okay-context.exp
eval-okay-context.nix
eval-okay-curpos.exp
eval-okay-curpos.nix
eval-okay-deepseq.exp
eval-okay-deepseq.nix
eval-okay-delayed-with-inherit.exp
eval-okay-delayed-with-inherit.nix
eval-okay-delayed-with.exp
eval-okay-delayed-with.nix
eval-okay-dynamic-attrs-2.exp
eval-okay-dynamic-attrs-2.nix
eval-okay-dynamic-attrs-bare.exp
eval-okay-dynamic-attrs-bare.nix
eval-okay-dynamic-attrs.exp
eval-okay-dynamic-attrs.nix
eval-okay-elem.exp
eval-okay-elem.nix
eval-okay-empty-args.exp
eval-okay-empty-args.nix
eval-okay-eq-derivations.exp
eval-okay-eq-derivations.nix
eval-okay-eq.exp.disabled
eval-okay-eq.nix
eval-okay-filter.exp
eval-okay-filter.nix
eval-okay-flatten.exp
eval-okay-flatten.nix
eval-okay-fromjson.exp
eval-okay-fromjson.nix
eval-okay-functionargs.exp.xml
eval-okay-functionargs.nix
eval-okay-getattrpos.exp
eval-okay-getattrpos.nix
eval-okay-getenv.exp
eval-okay-getenv.nix
eval-okay-hash.exp
eval-okay-hash.nix
eval-okay-if.exp
eval-okay-if.nix
eval-okay-import.exp
eval-okay-import.nix
eval-okay-ind-string.exp Fix lexer to support $' in multiline strings. 2017-05-01 01:15:40 +02:00
eval-okay-ind-string.nix Fix lexer to support $' in multiline strings. 2017-05-01 01:15:40 +02:00
eval-okay-let.exp
eval-okay-let.nix
eval-okay-list.exp
eval-okay-list.nix
eval-okay-listtoattrs.exp
eval-okay-listtoattrs.nix
eval-okay-logic.exp
eval-okay-logic.nix
eval-okay-map.exp
eval-okay-map.nix
eval-okay-new-let.exp
eval-okay-new-let.nix
eval-okay-null-dynamic-attrs.exp
eval-okay-null-dynamic-attrs.nix
eval-okay-overrides.exp
eval-okay-overrides.nix
eval-okay-partition.exp Add builtin function "partition" 2016-08-29 19:36:54 +02:00
eval-okay-partition.nix Add builtin function "partition" 2016-08-29 19:36:54 +02:00
eval-okay-path.nix Add path primop. 2018-02-06 16:48:08 -05:00
eval-okay-pathexists.exp
eval-okay-pathexists.nix
eval-okay-patterns.exp
eval-okay-patterns.nix
eval-okay-readDir.exp
eval-okay-readDir.nix
eval-okay-readfile.exp
eval-okay-readfile.nix
eval-okay-redefine-builtin.exp
eval-okay-redefine-builtin.nix
eval-okay-regex-match.exp
eval-okay-regex-match.nix Document that builtins.match takes a POSIX extended RE 2017-05-17 12:18:18 +02:00
eval-okay-regex-split.nix Add builtins.string function. 2017-08-15 20:04:11 +00:00
eval-okay-remove.exp
eval-okay-remove.nix
eval-okay-replacestrings.exp libexpr: Fix prim_replaceStrings() to work on an empty source string 2018-02-26 19:49:13 +02:00
eval-okay-replacestrings.nix libexpr: Fix prim_replaceStrings() to work on an empty source string 2018-02-26 19:49:13 +02:00
eval-okay-scope-1.exp
eval-okay-scope-1.nix
eval-okay-scope-2.exp
eval-okay-scope-2.nix
eval-okay-scope-3.exp
eval-okay-scope-3.nix
eval-okay-scope-4.exp
eval-okay-scope-4.nix
eval-okay-scope-6.exp
eval-okay-scope-6.nix
eval-okay-scope-7.exp
eval-okay-scope-7.nix
eval-okay-search-path.exp
eval-okay-search-path.flags
eval-okay-search-path.nix
eval-okay-seq.exp
eval-okay-seq.nix
eval-okay-sort.exp
eval-okay-sort.nix
eval-okay-splitversion.exp Add splitVersion primop. 2018-02-14 09:55:43 -05:00
eval-okay-splitversion.nix Add splitVersion primop. 2018-02-14 09:55:43 -05:00
eval-okay-string.exp
eval-okay-string.nix
eval-okay-strings-as-attrs-names.exp
eval-okay-strings-as-attrs-names.nix
eval-okay-substring.exp
eval-okay-substring.nix
eval-okay-tail-call-1.exp-disabled
eval-okay-tail-call-1.nix
eval-okay-tojson.exp
eval-okay-tojson.nix
eval-okay-toxml.exp
eval-okay-toxml.nix
eval-okay-toxml2.exp
eval-okay-toxml2.nix
eval-okay-tryeval.exp
eval-okay-tryeval.nix
eval-okay-types.exp
eval-okay-types.nix
eval-okay-versions.exp
eval-okay-versions.nix
eval-okay-with.exp
eval-okay-with.nix
eval-okay-xml.exp.xml
eval-okay-xml.nix
imported.nix
imported2.nix
lib.nix Revert "Don't parse "x:x" as a URI" 2017-11-14 15:10:52 +01:00
parse-fail-dup-attrs-1.nix
parse-fail-dup-attrs-2.nix
parse-fail-dup-attrs-3.nix
parse-fail-dup-attrs-4.nix
parse-fail-dup-attrs-6.nix
parse-fail-dup-attrs-7.nix
parse-fail-dup-formals.nix
parse-fail-patterns-1.nix
parse-fail-regression-20060610.nix
parse-fail-undef-var-2.nix
parse-fail-undef-var.nix
parse-okay-1.nix
parse-okay-crlf.nix
parse-okay-dup-attrs-5.nix
parse-okay-regression-751.nix
parse-okay-regression-20041027.nix
parse-okay-subversion.nix
parse-okay-url.nix Revert "Don't parse "x:x" as a URI" 2017-11-14 15:10:52 +01:00