Skip to content

Compiler auto-continue issue #38

@jpcompton

Description

@jpcompton

In trying to solve my own problem from #37 by reducing the number of printed messages, I've run into an oddity with the "condition has 6 conditions" error and the compiler's attempts to fix.

This original .sck code (see my source in #37 for full details) compiles and works:

 action give script when here players and flag 5 and here script
	print "We can play the MURDER OF GONZAGO!"
	print "They exit to the throne room"
	print "The play is ABOUT to begin!"
	put script throneroom
	destroy players

Decompiled, it becomes:

action GIV SCR when here Players and flag 5 and here Script
	print "We can play the MURDER OF GONZAGO!"
	print "They exit to the throne room"
	print "The play is ABOUT to begin!"
	continue

occur 0%
	put Script Room1
	destroy Players
	comment "cont"

However, if I edit that action into this:

action give script when here players and flag 5 and here script
	print "We can play the MURDER OF GONZAGO!
They exit to the throne room
The play is ABOUT to begin!"
	put script throneroom
	destroy players

then the following compiler bork occurs:

/Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/lib/scottkit/compile.rb:463:in `block in generate_code': condition has 6 conditions (RuntimeError)
	from /Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/lib/scottkit/compile.rb:457:in `each'
	from /Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/lib/scottkit/compile.rb:457:in `generate_code'
	from /Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/lib/scottkit/compile.rb:38:in `compile_to_stdout'
	from /Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/lib/scottkit/game.rb:287:in `compile_to_stdout'
	from /Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/bin/scottkit:115:in `block in <top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/lib/scottkit/withio.rb:11:in `withIO'
	from /Library/Ruby/Gems/2.3.0/gems/scottkit-1.6.0/bin/scottkit:114:in `<top (required)>'
	from /usr/local/bin/scottkit:22:in `load'
	from /usr/local/bin/scottkit:22:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions