+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: How do I fix an "EOF expected" error?

  1. #1
    Join Date
    Oct 2008
    Posts
    42

    Default How do I fix an "EOF expected" error?

    When testing the built-in extensions, about as often as not I wind up with an error message that ends with "EOF expected." I can't find a DekiScript definition of what constitutes and "EOF" (end of file?), so I have no idea how to fix these errors. A search for "EOF expected" didn't turn up anything in the forums or the Developer Wiki that helps. Where should I be looking for an answer, please?

  2. #2
    Join Date
    Jan 2008
    Posts
    146

    Default

    You'll often get that error in DekiScript if you're missing a semicolon ";" at the end of a line. For example:

    Code:
    {{
    var x = user.name
    web.text("Hello "..x);
    }}
    This code would produce an EOF error because it is missing a semicolon after user.name to signify that the line/argument is over. This is similar to how PHP and other languages work.

    Do you want to add this to the FAQ?
    Last edited by lktest; 11-25-2008 at 03:13 PM. Reason: auto-smileys keep brightening my day

  3. #3
    Join Date
    Oct 2008
    Posts
    42

    Default

    Thanks, but I still don't know how to fix it. I tried putting the semicolon in at various points and it doesn't fix the problem. Here's the actual code I'm using.
    Use this page to search only the Help pages:
    {{ dhtml.inputbox{value: __request.args.q, button: "Search 'Help'", field: "q", publish: page.uri} }}

    {{ if(__request.args.q) {wiki.search(__request.args.q, nil, nil, "Wikipath:ZzHelp/*")} }}

    I get the search box, but the results page won't display--that's where I'm getting the EOF error.

    Also, I'm skeptical that a semicolon is always the missing EOF--the part of my code that works has no semicolons in it...
    Last edited by wordsmith; 11-25-2008 at 04:10 PM. Reason: Add info

  4. #4
    Join Date
    Jan 2008
    Posts
    146

    Default

    In your code above, try changing "Wikipath:ZzHelp/*" to simply "path:ZzHelp/*".

    What might be borking is that you're using an incorrect search modifier, so instead interpreting the colon to be part of a search phrase, Deki is making its best guess that the colon is part of a DekiScript argument string (which would require a semicolon at the end to close it).

    If you haven't seen already, there's a FAQ on which search modifiers are safe to use.

  5. #5
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    I just tried the second line and it worked fine. What version are you running?
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  6. #6
    Join Date
    Oct 2008
    Posts
    42

    Default

    I'm running 8.08.1a. It's probably obvious that I found the code somewhere on the Deki site and copied it--I don't speak code of any kind, so I really don't know an "argument string" from a "search modifier." What's happening is that I'm getting a search box, but the results won't display, plus I'm getting "/p[2]/span, line 1, column 1: EOF expected".

    Entire code (which is actually giving me three consecutive EOF errors) is as follows.
    Use this page to search only the Help pages:
    {{ dhtml.inputbox{value: __request.args.q, button: "Search 'Help'", field: "q", publish: page.uri} }}

    {{ if(__request.args.q) {wiki.search(__request.args.q, nil, nil, "wikipath:ZzHelp/*");} }}


    {{<?php echo "<a href='javascript: void(0)' onclick=""window.open(pop.<wbr/>php?pid='$<wbr/>pop', 'Special:Search', 'width=200, height=77, left=500, top=200'); return false;"">Click here </a>"; ?>{}}}}



    {{<a target="_blank" href="Special:Search">search results</a>{}}}
    Last edited by wordsmith; 11-25-2008 at 08:10 PM. Reason: Adding more code samples

  7. #7
    Join Date
    Feb 2008
    Location
    London upon Thames
    Posts
    2,792

    Default

    Where did you get this example from? This example seems much cleaner..

    I think the bottom two lines aren't meant to be there.

    Code:
    {{ dhtml.inputbox{value: __request.args.q, button: "Search 'Tree'", field: "q", publish: page.uri} }}
    
    {{ if(__request.args.q) { wiki.search(__request.args.q, nil, nil, "path:Tree/*"); } }}
    This example will search subpages of the "Tree" page for the text you enter into the box. I don't know if you have a page called Zzhelp, but if you don't, you won't get interesting results!
    Last edited by crb; 11-25-2008 at 09:27 PM.

  8. #8
    Join Date
    Oct 2008
    Posts
    42

    Default

    One of the fun things about the Deki site is that, if I find something interesting and fail to bookmark it, I can never find it again, so I really can't tell you where I found that sample. I do have a page named "zzHelp" (wanted it to show up always at the bottom of the TOC). I'll try the cleaner search. However, I still don't have an answer for what an "EOF" is. I get a lot of those--not just this instance. Does that always mean I'm missing a semi-colon somewhere?

  9. #9
    Join Date
    Feb 2008
    Location
    London upon Thames
    Posts
    2,792

    Default

    EOF means something wasn't closed - could be mismatched { } s also.

  10. #10
    Join Date
    Oct 2008
    Posts
    42

    Default

    Thanks. I guess that helps, although I've tried adding curly brackets and that doesn't seem to fix them either. The extensions apparently really aren't meant for use by admins who don't know DekiScript.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts