From 2fa8f7cfa978b74f2a0ce44d5a2b784489716fc1 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 25 Feb 2019 09:42:47 -0500 Subject: [PATCH] catchup --- cgi.d | 20 ++++++++++++++++++++ script.d | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/cgi.d b/cgi.d index 99633c8..daee713 100644 --- a/cgi.d +++ b/cgi.d @@ -6774,8 +6774,10 @@ bool restObjectServeHandler(T)(Cgi cgi, string url) { auto div = Element.make("div"); div.addClass("Dclass_" ~ T.stringof); div.dataset.url = urlId; + bool first = true; static foreach(idx, memberName; __traits(derivedMembers, T)) static if(__traits(compiles, __traits(getMember, obj, memberName).offsetof)) { + if(!first) div.addChild("br"); else first = false; div.appendChild(formatReturnValueAsHtml(__traits(getMember, obj, memberName))); } return div; @@ -6986,6 +6988,24 @@ bool restObjectServeHandler(T)(Cgi cgi, string url) { return true; } +/+ +struct SetOfFields(T) { + private void[0][string] storage; + void set(string what) { + //storage[what] = + } + void unset(string what) {} + void setAll() {} + void unsetAll() {} + bool isPresent(string what) { return false; } +} ++/ + +/+ +enum readonly; +enum hideonindex; ++/ + /++ Serves a static file. To be used with [dispatcher]. +/ diff --git a/script.d b/script.d index e9e75ae..ae106c9 100644 --- a/script.d +++ b/script.d @@ -90,6 +90,8 @@ obj.__prop("name", value); // bypasses operator overloading, useful for use inside the opIndexAssign especially Note: if opIndex is not overloaded, getting a non-existent member will actually add it to the member. This might be a bug but is needed right now in the D impl for nice chaining. Or is it? FIXME + + FIXME: it doesn't do opIndex with multiple args. * if/else * array slicing, but note that slices are rvalues currently * variables must start with A-Z, a-z, _, or $, then must be [A-Za-z0-9_]*. @@ -2304,7 +2306,9 @@ Expression parseExpression(MyTokenStreamHere)(ref MyTokenStreamHere tokens, bool auto ident = tokens.requireNextToken(ScriptToken.Type.identifier); tokens.requireNextToken(ScriptToken.Type.symbol, "("); - auto args = parseVariableDeclaration(tokens, ")"); + VariableDeclaration args; + if(!tokens.peekNextToken(ScriptToken.Type.symbol, ")")) + args = parseVariableDeclaration(tokens, ")"); tokens.requireNextToken(ScriptToken.Type.symbol, ")"); auto bod = parseExpression(tokens);