diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-10-27 13:00:31 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-10-27 13:00:31 +0000 |
commit | 3277c9432ab718c8b80c54b228f8d5fbf94fb033 (patch) | |
tree | 6af9b959a1e5c961946fb3e855787f981d8a980c | |
parent | 463e2817c55fbd5b026d7dd630541b990b82418a (diff) | |
download | guix-3277c9432ab718c8b80c54b228f8d5fbf94fb033.tar.gz |
* Bug fix in parsing of /* ... */ comments; due to longest match
regexp there could be only one such comment per file.
-rw-r--r-- | src/libexpr/lexer.l | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/lang/parse-okay-regression-20041027.exp | 1 | ||||
-rw-r--r-- | tests/lang/parse-okay-regression-20041027.nix | 11 |
4 files changed, 14 insertions, 2 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index 78d08d0725..38d403c9fa 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -76,7 +76,7 @@ inherit { return INHERIT; } [ \t\n]+ /* eat up whitespace */ \#[^\n]* /* single-line comments */ -\/\*(.|\n)*\*\/ /* long comments */ +\/\*([^*]|\*[^\/])*\*\/ /* long comments */ . return yytext[0]; diff --git a/tests/Makefile.am b/tests/Makefile.am index ae6da726b3..038503aaad 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,7 +27,7 @@ TESTS = init.sh lang.sh simple.sh dependencies.sh locking.sh parallel.sh \ XFAIL_TESTS = -foo: +langtests: $(TESTS_ENVIRONMENT) ./lang.sh include ../substitute.mk diff --git a/tests/lang/parse-okay-regression-20041027.exp b/tests/lang/parse-okay-regression-20041027.exp new file mode 100644 index 0000000000..f3bee28b86 --- /dev/null +++ b/tests/lang/parse-okay-regression-20041027.exp @@ -0,0 +1 @@ +Function([NoDefFormal("stdenv"),NoDefFormal("fetchurl")],Call(Select(Var("stdenv"),"mkDerivation"),Attrs([Bind("name",Str("libXi-6.0.1"),Pos("(string)",4,7)),Bind("src",Call(Var("fetchurl"),Attrs([Bind("url",Uri("http://freedesktop.org/~xlibs/release/libXi-6.0.1.tar.bz2"),Pos("(string)",6,8)),Bind("md5",Str("7e935a42428d63a387b3c048be0f2756"),Pos("(string)",7,8))])),Pos("(string)",5,6))])),Pos("(string)",1,2)) diff --git a/tests/lang/parse-okay-regression-20041027.nix b/tests/lang/parse-okay-regression-20041027.nix new file mode 100644 index 0000000000..ae2e256eea --- /dev/null +++ b/tests/lang/parse-okay-regression-20041027.nix @@ -0,0 +1,11 @@ +{stdenv, fetchurl /* pkgconfig, libX11 */ }: + +stdenv.mkDerivation { + name = "libXi-6.0.1"; + src = fetchurl { + url = http://freedesktop.org/~xlibs/release/libXi-6.0.1.tar.bz2; + md5 = "7e935a42428d63a387b3c048be0f2756"; + }; +/* buildInputs = [pkgconfig]; + propagatedBuildInputs = [libX11]; */ +} |