New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vibe no longer understands my diet template files #155

Closed
eskimor opened this Issue Jan 10, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@eskimor

eskimor commented Jan 10, 2013

Hi!

With current master (1e5db18) I get the following error messages:

robert@linuxPC:~/projects/tester_stats> vibe
Checking dependencies in '/home/robert/projects/tester_stats'
filterform.dt(1): Error: #line integer ["filespec"]\n expected
filterform.dt(2): Error: found 'import' when expecting ';' following statement
filterform.dt(3): Error: #line integer ["filespec"]\n expected
filterform.dt(4): Error: found '}' when expecting ';' following statement
filterform.dt(2): Error: #line integer ["filespec"]\n expected
filterform.dt(3): Error: found 'import' when expecting ';' following statement
filterform.dt(4): Error: #line integer ["filespec"]\n expected
filterform.dt(5): Error: found '}' when expecting ';' following statement
filterform.dt(3): Error: #line integer ["filespec"]\n expected
filterform.dt(4): Error: found 'import' when expecting ';' following statement
filterform.dt(5): Error: #line integer ["filespec"]\n expected
filterform.dt(6): Error: found '}' when expecting ';' following statement
filterform.dt(25): Error: found 'EOF' when expecting '}' following compound statement
filterform.dt(25): Error: found 'EOF' when expecting '}' following compound statement
filterform.dt(25): Error: found 'EOF' when expecting '}' following compound statement
filterform.dt(1): Error: string has no effect in expression ("")
filterform.dt(2): Error: module range has no effect
filterform.dt(3): Error: string has no effect in expression ("")
filterform.dt(2): Error: string has no effect in expression ("")
filterform.dt(3): Error: module dynamicinput has no effect
filterform.dt(4): Error: string has no effect in expression ("")
Failed: 'dmd' '-debug' '-g' '-w' '-property' '-g' '-I/home/robert/projects/vibe.d/source' '-Isource' '-Jviews' '-I/home/robert/projects' '-L-lssl' '-L-lpq' '-Isource' '-Jviews' '-L-levent_pthreads' '-L-levent' '-L-lssl' '-L-lcrypto' '-v' '-o-' 'source/app.d' '-Isource'
robert@linuxPC:~/projects/tester_stats> 

for the following diet template:

robert@linuxPC:~/projects/tester_stats> cat views/filterform.dt
-import std.range;
-import widgets.dynamicinput;
-import tester.dbtables;
#filterbox.mainbox
    form(method="get", action="#{resource}", class='settingsForm')
        h2 Filters
        #datefilter
            h3 Date & Autorun
            - auto date_input=DynamicInput!DateSpan("q_filter_datespan");
            - date_input.columnTypes=[InputTypes.date, InputTypes.date, InputTypes.select];
            - date_input.labels=["From", "To", "Autorun"];
            - date_input.choices[2]~="";
            - foreach(run; retro(db.autoRuns))
                - date_input.choices[2]~=run;
            - date_input.render(res, q.filter.datespan);
        #testedhardwarefilter
            h3 Tested Hardware
            - auto hw_input=DynamicInput!Hardware("q_filter_testedHardware");
            - hw_input.labels=["Name", "Serial", "Manufacturer"];
            - hw_input.render(res, q.filter.testedHardware);
            h3 Used Hardware:
            - hw_input.prefix="q_filter_usedHardware";
            - hw_input.render(res, q.filter.usedHardware);
            - renderHiddenFields(req, res, ["q_filter", "q_browserDisplay"]);
        button(id="filterButton", type="submit", class='settingsForm') Filter
robert@linuxPC:~/projects/tester_stats> 

It used to work with vibe prior to: 1e5db18

I tried to git bisect it to a concrete commit, but prior to commit: 65f5df4
I get the following error:

robert@linuxPC:~/projects/tester_stats> vibe
Checking dependencies in '/home/robert/projects/tester_stats'
widgets/dynamicinput.dt(21): Error: found 'htmlAttribEscape' when expecting ','
widgets/dynamicinput.dt(23): Error: found 'htmlAttribEscape' when expecting ','
widgets/dynamicinput.dt(21): Error: function vibe.core.stream.OutputStream.write (const(ubyte[]) bytes, bool do_flush = true) is not callable using argument types (string,string,bool)
widgets/dynamicinput.dt(21): Error: cannot implicitly convert expression (htmlAttribEscape(_toString(this.prefix))) of type string to vibe.core.stream.InputStream
widgets/dynamicinput.dt(21): Error: cannot implicitly convert expression (_toString(row)) of type string to ulong
widgets/dynamicinput.dt(23): Error: function vibe.core.stream.OutputStream.write (const(ubyte[]) bytes, bool do_flush = true) is not callable using argument types (string,string,bool)
widgets/dynamicinput.dt(23): Error: cannot implicitly convert expression (htmlAttribEscape(_toString(this.prefix))) of type string to vibe.core.stream.InputStream
widgets/dynamicinput.dt(23): Error: cannot implicitly convert expression (_toString(row)) of type string to ulong
widgets/dynamicinput.dt(21): Error: function vibe.core.stream.OutputStream.write (const(ubyte[]) bytes, bool do_flush = true) is not callable using argument types (string,string,bool)
widgets/dynamicinput.dt(21): Error: cannot implicitly convert expression (htmlAttribEscape(_toString(this.prefix))) of type string to vibe.core.stream.InputStream
widgets/dynamicinput.dt(21): Error: cannot implicitly convert expression (_toString(row)) of type string to ulong
widgets/dynamicinput.dt(23): Error: function vibe.core.stream.OutputStream.write (const(ubyte[]) bytes, bool do_flush = true) is not callable using argument types (string,string,bool)
widgets/dynamicinput.dt(23): Error: cannot implicitly convert expression (htmlAttribEscape(_toString(this.prefix))) of type string to vibe.core.stream.InputStream
widgets/dynamicinput.dt(23): Error: cannot implicitly convert expression (_toString(row)) of type string to ulong
widgets/dynamicinput.dt(21): Error: function vibe.core.stream.OutputStream.write (const(ubyte[]) bytes, bool do_flush = true) is not callable using argument types (string,string,bool)
widgets/dynamicinput.dt(21): Error: cannot implicitly convert expression (htmlAttribEscape(_toString(this.prefix))) of type string to vibe.core.stream.InputStream
widgets/dynamicinput.dt(21): Error: cannot implicitly convert expression (_toString(row)) of type string to ulong
widgets/dynamicinput.dt(23): Error: function vibe.core.stream.OutputStream.write (const(ubyte[]) bytes, bool do_flush = true) is not callable using argument types (string,string,bool)
widgets/dynamicinput.dt(23): Error: cannot implicitly convert expression (htmlAttribEscape(_toString(this.prefix))) of type string to vibe.core.stream.InputStream
widgets/dynamicinput.dt(23): Error: cannot implicitly convert expression (_toString(row)) of type string to ulong
filterform.dt(9): Error: template instance widgets.dynamicinput.DynamicInput!(DateSpan) error instantiating
Failed: 'dmd' '-debug' '-g' '-w' '-property' '-g' '-I/home/robert/projects/vibe.d/source' '-Isource' '-Jviews' '-I/home/robert/projects' '-L-lssl' '-L-lpq' '-Isource' '-Jviews' '-L-levent_pthreads' '-L-levent' '-L-lssl' '-L-lcrypto' '-v' '-o-' 'source/app.d' '-Isource'
robert@linuxPC:~/projects/tester_stats> 

for the following diet file:

robert@linuxPC:~/projects/tester_stats> cat views/widgets/dynamicinput.dt
-import std.conv;

fieldset(id="#{prefix}_fieldset", class="filter_fieldset#{fieldCount}")
    table(id="#{prefix}_input")
        tr
            -int i=0;
            -foreach(c; __traits(allMembers, typeof(initial_values[0])))
                -if(labels[i]=="")
                    th #{c}
                -else
                    th #{labels[i]}
                -i++;
        -foreach(row, data; initial_values)
            -if(row!=0 && data==typeof(data).init) 
                -break;
            tr
                -i=0;
                -foreach(c; __traits(allMembers, typeof(initial_values[0])))
                    -auto value=__traits(getMember, initial_values[row], c);
                    td
                        -if(columnTypes[i]==InputTypes.select)
                            select(name="#{prefix}#{row}_#{c}")
                                -foreach(choice; choices[i])
                                    -if(choice==value)
                                        option(value="#{choice}", selected) #{choice}
                                    -else
                                        option(value="#{choice}") #{choice}
                        -else
                            input(type="#{to!string(columnTypes[i])}", name="#{prefix}#{row}_#{c}", value="#{value}")
                    -i++;
    script
        #{prefix}Adder=new RowAdder('#{prefix}', '#{prefix}_input')
    button(type="button", name="or", onclick="#{prefix}Adder.addRow()", class="or_add_row") Add Alternative
robert@linuxPC:~/projects/tester_stats>

I can't really tell if it got worse ( so that filterform failed before dynamicinput) or better (dynamic input got fixed and only filterform fails now).

Thanks a lot.

Best regards,

Robert

s-ludwig added a commit that referenced this issue Jan 10, 2013

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Jan 10, 2013

Member

Okay, first I couldn't reproduce it, but it turned out that was caused by the changes in 23e60b0 and 8cb1027. Some invalid line markers were output. Should be fixed now.

Member

s-ludwig commented Jan 10, 2013

Okay, first I couldn't reproduce it, but it turned out that was caused by the changes in 23e60b0 and 8cb1027. Some invalid line markers were output. Should be fixed now.

@eskimor

This comment has been minimized.

Show comment
Hide comment
@eskimor

eskimor Jan 10, 2013

Thanks! Compiles again.

eskimor commented Jan 10, 2013

Thanks! Compiles again.

@eskimor eskimor closed this Jan 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment