     doit() if cond1 if cond2
 """
 
+ast.if4
+
 src.string1 = """
     x = "string"
 """

                print "Warning, unused regex '#{regex}'\n"
    return tests

# Run one test.
# name: name of the test. The test must fail iff the name starts with "fail_".
# src:  source string of the test.
# ast:  AST that must be produced as a result (optional).
# logger: what to do if a test fails.
runTest = (name, src, ast, logger) ->
    logger ?= print
    print "\n***** Test #{name} *****\n"


#-------------------------------------------------------------------------------
# Enable this to print array elements.
if true
    Array.prototype.toString = -> '[ ' + (@join ', ') + ' ]'

#-------------------------------------------------------------------------------
# Enable this to prevent function printing from dumping whole sources
if true
    Function.prototype.toString = -> "<FUNCTION>"

#-------------------------------------------------------------------------------
# Enable this to print objects content.
if false
    Object.prototype.toString = ->
        '{' + (("#{k}: #{v}" for k, v of @).join ', ') + '}'

#-------------------------------------------------------------------------------
# Imports
cs = require "../src/CoffeeScriptParser"
gg = require "../src/GrammarGenerator"
{ tree, toIndentedString, equal:astEqual } = require '../src/Tree'

#-------------------------------------------------------------------------------
# set of source strings, indexed by names, to be run as tests.
# Each string must be a valid coffeescript block, unless its
# name starts with "fail_": in this case it must *not* parse
# correctly.
#-------------------------------------------------------------------------------
src = { }

#-------------------------------------------------------------------------------
# set of expected ASTs, indexed by names. An AST is optional
# in a test, but if there is one, then the result of the parser
# must match.
#-------------------------------------------------------------------------------
ast = { }

#-------------------------------------------------------------------------------
#--- TESTS ---------------------------------------------------------------------
#-------------------------------------------------------------------------------

# basic identifier
src.id = "foo"
