Language-Basic

 view release on metacpan or  search on metacpan

lib/Language/Basic/Statement.pm  view on Meta::CPAN

    # Until the token "ELSE" or the end of the line, is one or more
    # statements to do if the IF is true
    # TODO we need to handle ELSE either within the same statement
    # as the last THEN statement *OR* at the beginning of a statement.
    # Also nested IFs?

    # Take everything up to ELSE into a separate Token::Group &
    # call parsing with that so that other parse routines can complain if
    # there's something left in their token_group. Right now, they'll have
    # problem with ELSE token
    # TODO need a Token::Group::split method or some such
    my $t1 = new Language::Basic::Token::Group;
    $t1->slurp($token_group, "ELSE");

    # Call new with an extra arg so it knows it's parsing a THEN/ELSE.
    # That way, "THEN 20" gets parsed like "THEN GOTO 20"
    my $then = new Language::Basic::Statement $t1, "line_num_ok" or
	Exit_Error("No statement found after THEN");
    $then->parse($t1);
    my $oldst = $then;
    # Eat [: Statement]*



( run in 0.752 second using v1.01-cache-2.11-cpan-71847e10f99 )