Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

missing ) after argument list and unexpected token

edited May 2017 in Help! with 2.0
I am using Harlowe 1.2.4 and Twine 2.1.3 and I'm getting an error on several mobile devices, the error (alert) is: "missing ) after argument list", while on other devices "Unexpected token =>". I believe that the issue is from the code below, the error didn't came up when I excluded this passage, however everything seems fine to me. Any solution or suggestion?
{   <div class="container home-menu">
    <div class="row content-1">
        <div class="col-xs-12 text-center">
            <!-- Menu -->
            <img style="height:90px;" src="res/images/splash_logo.png"/><br>
(unless: (saved-games:) contains $_autosave_slot and (datavalues: (saved-
games:)) contains $_autosave_filename)[(goto: $_start_passage)]
}''<span class="home-button">[[New->$_start_passage]]</span><br>
<span class="home-button">(link: "Continue")[(load-game: $_autosave_slot)]
</span>''<br><a href="#" onClick="closeMeNow();" class="home-
button">Exit</a>
            <!-- Credits -->
<div class="bottom-links"><a href="contact.html"><span style="color: 
white;">some text</span></a><br>
            <a href="credits.html"><span style="color: white;">some text</span></a></div>
        </div>
    </div>      
</div>
<script> function closeMeNow() { navigator.app.exitApp();} </script>

Comments

  • For who is facing similar issue it may help: I fixed it by addding my other JS code to the generated .html file or as an external source, rather than directly into Twine Engine's Javascript section.
  • There are a number of syntax and structural issues with your code example.

    To illustrate the issues the following was modified to include the HTML elements representing the Collapsing white-space & Bolding markup, and more indentation to highlight the potential HTML structure being generated.
    <tw-collapsed>
    	<div class="container home-menu">
    		<div class="row content-1">
    			<div class="col-xs-12 text-center">
    				<!-- Menu -->
    				<img style="height:90px;" src="res/images/splash_logo.png"/>
    				<br>
    				(unless: (saved-games:) contains $_autosave_slot and (datavalues: (saved-
    games:)) contains $_autosave_filename)[
    					(goto: $_start_passage)
    				]
    
    </tw-collapsed>
    
    				<b>
    					<span class="home-button">
    						[[New->$_start_passage]]
    					</span>
    					<br>
    					<span class="home-button">
    						(link: "Continue")[
    							(load-game: $_autosave_slot)
    						]
    					</span>
    				</b>
    
    				<br>
    				<a href="#" onClick="closeMeNow();" class="home-
    button">Exit</a>
    				<!-- Credits -->
    				<div class="bottom-links">
    					<a href="contact.html">
    						<span style="color: 
    white;">some text</span>
    					</a>
    					<br>
    					<a href="credits.html">
    						<span style="color: white;">some text</span>
    					</a>
    				</div>
    			</div>
    		</div>
    	</div>
    	<script> function closeMeNow() { navigator.app.exitApp();} </script>
    
    The following is a break down of the issues in your example:


    1. You have invalid line-breaks in the middle of a macro name, a CSS class name, and a CSS property / value pair.
    and (datavalues: (saved-
    games:)) contains
    
    
    class="home-
    button">Exit</a>
    
    style="color:
    white;">some text</span>
    


    2. You are ending the Collapsing white-space (<tw-collapsed>) element before ending the div elements contained within it. The web-browser may try to auto-correct this issue by moving the </tw-collapsed> to after the last </div> for you.

    3. You are conditionally redirecting the reader to another passage after you start constructing your div elements instead of doing it before that.

    The following is a corrected version of your example.
    (unless: (saved-games:) contains $_autosave_slot and (datavalues: (saved-games:)) contains $_autosave_filename)[(goto: $_start_passage)]
    
    {
    <div class="container home-menu">
    	<div class="row content-1">
    		<div class="col-xs-12 text-center">
    			<!-- Menu -->
                <img style="height:90px;" src="res/images/splash_logo.png"/>
    			<br>
    			''
    				<span class="home-button">[[New->$_start_passage]]</span>
    				<br>
    				<span class="home-button">(link: "Continue")[(load-game: $_autosave_slot)]</span>
    			''
    			<br>
    			<a href="#" onClick="closeMeNow();" class="home-button">Exit</a>
    			<!-- Credits -->
    			<div class="bottom-links">
    				<a href="contact.html">
    					<span style="color: white;">some text</span>
    				</a>
    				<br>
    				<a href="credits.html">
    					<span style="color: white;">some text</span>
    				</a>
    			</div>
    		</div>
    	</div>      
    </div>
    }
    <script> function closeMeNow() { navigator.app.exitApp();} </script>
    
    NOTE: I have included extra indentation and line-breaks in the above so that you can see the differences, you may wish to remove them.
  • I tested my work on various devices and everything seems to be as it should, however I may look into it based on your reply. Thank you, I really appreciate the effort.
Sign In or Register to comment.