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..cb105d8 --- /dev/null +++ b/dub.sdl @@ -0,0 +1,18 @@ +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.1.0" + subConfiguration "linenoise" "vendored" + targetType "executable" + mainSourceFile "src/console.d" +} +configuration "library" { + targetType "library" + excludedSourceFiles "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" } } 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); 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