<commit_before>/**
 * Represents a single line of code.
 *
 * @author <NAME>, <NAME>
 * @version 1.0
 */

package ambroscum.lines;

import ambroscum.*;
import ambroscum.parser.TokenStream;

public abstract class Line
{
	public abstract void evaluate(IdentifierMap values);
<<<<<<< HEAD

	public static Line evalAsLine(TokenStream stream)
	{
		Token token = stream.getFirst();
		if (token.toString().equals("assert"))
		{
			stream.removeFirst();
			return new AssertLine(stream);
		}
		if (token.toString().equals("print") || token.toString().equals("println"))
		{
			stream.removeFirst();
			return new PrintLine(stream, token.length() == 7);
		}
//		if (code.contains(" = "))
//		{
//			int index = code.indexOf(" = ");
//			return new AssignmentLine(code.substring(0, index), code.substring(index + 3));
//		}
		throw new UnsupportedOperationException();
	}
}<commit_msg>Modified Line to use the token stream<commit_after>/**
 * Represents a single line of code.
 *
 * @author <NAME>, <NAME>
 * @version 1.0
 */

package ambroscum.lines;

import ambroscum.*;
import ambroscum.parser.TokenStream;

public abstract class Line
{
	public abstract void evaluate(IdentifierMap values);
<<<<<<< HEAD

	public static Line evalAsLine(TokenStream stream)
	{
		Token token = stream.getFirst();
		if (token.toString().equals("assert"))
		{
			stream.removeFirst();
			return new AssertLine(stream);
		}
		if (token.toString().equals("print") || token.toString().equals("println"))
		{
			stream.removeFirst();
			return new PrintLine(stream, token.length() == 7);
		} else {
			// Look-ahead to see if we hit '=' before the next line
			Iterator<Token> streamIter;
			while (streamIter.hasNext()) {
				Token next = streamIter.next();
				String str = next.getString();
				if (str.equals("=")) {
					return new AssignmentLine(stream);
				} else if (str.equals("\n")) {
					throw new UnsupportedOperationException("Call expressions not implemented!");
				}
			}
			//int index = first.indexOf(" = ");
			//return new AssignmentLine(first.substring(0, index), first.substring(index + 3));
//		if (code.contains(" = "))
//		{
//			int index = code.indexOf(" = ");
//			return new AssignmentLine(code.substring(0, index), code.substring(index + 3));
//		}
		throw new UnsupportedOperationException();
	}
}
{'fraction_non_alphanumeric': 0.16275021758050479, 'fraction_numerical': 0.005221932114882507, 'mean_word_length': 3.809623430962343, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4462848', 'n_tokens_mistral': 799, 'n_tokens_neox': 710, 'n_words': 180}