javax0.jamal.prog.analyzer.Assignment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jamal-prog Show documentation
Show all versions of jamal-prog Show documentation
Jamal module for Programmatic Extension
package javax0.jamal.prog.analyzer;
import javax0.jamal.api.BadSyntax;
public class Assignment {
public static javax0.jamal.prog.commands.Assignment analyze(final Lex.List lexes) throws BadSyntax {
final var variable = lexes.next().text;
lexes.assume(Lex.Type.RESERVED, "=", "Expected '=' after for variable");
final var expression = Expression.analyze(lexes);
lexes.eol("Expected new line after assignment");
return new javax0.jamal.prog.commands.Assignment(variable, expression);
}
}