From 10d393400f19e3490742aa5fcdcfd0240ab98646 Mon Sep 17 00:00:00 2001 From: Martin Nowak Date: Tue, 31 Oct 2017 23:59:50 +0100 Subject: [PATCH 1/4] convert to dub.sdl --- dub.json | 27 --------------------------- dub.sdl | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 27 deletions(-) delete mode 100644 dub.json create mode 100644 dub.sdl diff --git a/dub.json b/dub.json deleted file mode 100644 index 017f9f1..0000000 --- a/dub.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "drepl", - "description": "A D interpreter.", - "copyright": "Copyright © 2014-2016, DREPL team", - "license": "BSL-1.0", - "authors": ["Martin Nowak"], - "lflags-linux-dmd": ["-l:libphobos2.so", "-ldl"], - "configurations": [ - { - "name": "console", - "mainSourceFile": "src/console.d", - "dependencies": { - "linenoise": "~>1.0.0" - }, - "targetType": "executable", - }, - { - "name": "library", - "excludedSourceFiles": ["src/console.d"], - "targetType": "library", - }, - ], - "dependencies": { - "colorize": "~>1.0.5", - "libdparse": "~>0.7.1-beta.6" - }, -} diff --git a/dub.sdl b/dub.sdl new file mode 100644 index 0000000..a5900aa --- /dev/null +++ b/dub.sdl @@ -0,0 +1,17 @@ +name "drepl" +description "A D interpreter." +authors "Martin Nowak" +copyright "Copyright © 2014-2016, DREPL team" +license "BSL-1.0" +dependency "libdparse" version=">=0.7.1-beta.6 <0.8.0-0" +dependency "colorize" version="~>1.0.5" +lflags "-l:libphobos2.so" "-ldl" platform="linux-dmd" +configuration "console" { + dependency "linenoise" version="~>1.0.0" + targetType "executable" + mainSourceFile "src/console.d" +} +configuration "library" { + targetType "library" + excludedSourceFiles "src/console.d" +} From 77eac8c8d2cfefe548fea7be7a5a3436b97d123a Mon Sep 17 00:00:00 2001 From: Martin Nowak Date: Wed, 28 Feb 2018 20:25:38 +0100 Subject: [PATCH 2/4] use vendored linenoise library --- dub.sdl | 3 ++- dub.selections.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dub.sdl b/dub.sdl index a5900aa..cb105d8 100644 --- a/dub.sdl +++ b/dub.sdl @@ -7,7 +7,8 @@ dependency "libdparse" version=">=0.7.1-beta.6 <0.8.0-0" dependency "colorize" version="~>1.0.5" lflags "-l:libphobos2.so" "-ldl" platform="linux-dmd" configuration "console" { - dependency "linenoise" version="~>1.0.0" + dependency "linenoise" version="~>1.1.0" + subConfiguration "linenoise" "vendored" targetType "executable" mainSourceFile "src/console.d" } diff --git a/dub.selections.json b/dub.selections.json index 1895daa..d877ecb 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -3,6 +3,6 @@ "versions": { "colorize": "1.0.5", "libdparse": "0.7.1-beta.6", - "linenoise": "1.0.0" + "linenoise": "1.1.0+1.0.0" } } From 8ca085a3003fc449efa306c5e1af417ed5ac5329 Mon Sep 17 00:00:00 2001 From: Martin Nowak Date: Wed, 28 Feb 2018 21:15:21 +0100 Subject: [PATCH 3/4] fix compilation with 2.078 --- src/drepl/interpreter.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/drepl/interpreter.d b/src/drepl/interpreter.d index 0dd3926..74aa73c 100644 --- a/src/drepl/interpreter.d +++ b/src/drepl/interpreter.d @@ -145,9 +145,10 @@ private: Appender!(char[]) _incomplete; } -Interpreter!Engine interpreter(Engine)(auto ref Engine e) if (isEngine!Engine) +Interpreter!Engine interpreter(Engine)(return scope Engine e) if (isEngine!Engine) { - return Interpreter!Engine(move(e)); + // workaround Issue with return scope detection + return Interpreter!Engine(() @trusted { return move(e); }()); } unittest From fefaaf1edc444671dc87de013d5553847e1b1e95 Mon Sep 17 00:00:00 2001 From: Martin Nowak Date: Wed, 28 Feb 2018 21:16:27 +0100 Subject: [PATCH 4/4] drop removed comma expression --- src/drepl/engines/dmd.d | 1 - 1 file changed, 1 deletion(-) diff --git a/src/drepl/engines/dmd.d b/src/drepl/engines/dmd.d index 0a4feee..31faef5 100644 --- a/src/drepl/engines/dmd.d +++ b/src/drepl/engines/dmd.d @@ -242,7 +242,6 @@ unittest dmd = dmdEngine(); assert(dmd.evalDecl("void foo() {}") == ER(true, "foo")); assert(dmd.evalExpr("foo()") == ER(true, "void")); - assert(dmd.evalExpr("foo(), 3") == ER(true, "3")); dmd = dmdEngine(); assert(dmd.evalDecl("import std.stdio;").success);