Package fr.insalyon.citi.golo.compiler.GoloCompilationException

Examples of fr.insalyon.citi.golo.compiler.GoloCompilationException.Problem


      compileAndLoadGoloModule(SRC, "failure-undeclared-parameter.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException expected) {
      List<GoloCompilationException.Problem> problems = expected.getProblems();
      assertThat(problems.size(), is(1));
      Problem problem = problems.get(0);
      assertThat(problem.getType(), is(UNDECLARED_REFERENCE));
      assertThat(problem.getSource().getIrElement(), instanceOf(ReferenceLookup.class));
      ReferenceLookup lookup = (ReferenceLookup) problem.getSource().getIrElement();
      assertThat(lookup.getName(), is("some_parameter"));
      assertThat(lookup.getPositionInSourceCode().getLine(), is(4));
      assertThat(lookup.getPositionInSourceCode().getColumn(), is(13));
      throw expected;
    }
View Full Code Here


      compileAndLoadGoloModule(SRC, "failure-assign-to-undeclared-reference.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException expected) {
      List<GoloCompilationException.Problem> problems = expected.getProblems();
      assertThat(problems.size(), is(1));
      Problem problem = problems.get(0);
      assertThat(problem.getType(), is(UNDECLARED_REFERENCE));
      assertThat(problem.getSource(), instanceOf(ASTAssignment.class));
      ASTAssignment assignment = (ASTAssignment) problem.getSource();
      assertThat(assignment.getName(), is("bar"));
      assertThat(assignment.getLineInSourceCode(), is(5));
      assertThat(assignment.getColumnInSourceCode(), is(3));
      throw expected;
    }
View Full Code Here

      compileAndLoadGoloModule(SRC, "failure-assign-constant.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException expected) {
      List<GoloCompilationException.Problem> problems = expected.getProblems();
      assertThat(problems.size(), is(1));
      Problem problem = problems.get(0);
      assertThat(problem.getType(), is(ASSIGN_CONSTANT));
      assertThat(problem.getSource().getIrElement(), instanceOf(AssignmentStatement.class));
      AssignmentStatement statement = (AssignmentStatement) problem.getSource().getIrElement();
      assertThat(statement.getLocalReference().getName(), is("foo"));
      assertThat(statement.getPositionInSourceCode().getLine(), is(7));
      assertThat(statement.getPositionInSourceCode().getColumn(), is(3));
      throw expected;
    }
View Full Code Here

      compileAndLoadGoloModule(SRC, "failure-missing-ref-in-closure.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException expected) {
      List<GoloCompilationException.Problem> problems = expected.getProblems();
      assertThat(problems.size(), is(1));
      Problem problem = problems.get(0);
      assertThat(problem.getType(), is(UNDECLARED_REFERENCE));
      throw expected;
    }
  }
View Full Code Here

      compileAndLoadGoloModule(SRC, "failure-double-declaration.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException expected) {
      List<GoloCompilationException.Problem> problems = expected.getProblems();
      assertThat(problems.size(), is(1));
      Problem problem = problems.get(0);
      assertThat(problem.getType(), is(REFERENCE_ALREADY_DECLARED_IN_BLOCK));
      throw expected;
    }
  }
View Full Code Here

    try {
      compileAndLoadGoloModule(SRC, "failure-invalid-break.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException e) {
      assertThat(e.getProblems().size(), is(1));
      Problem problem = e.getProblems().get(0);
      assertThat(problem.getType(), is(BREAK_OR_CONTINUE_OUTSIDE_LOOP));
    }
  }
View Full Code Here

    try {
      compileAndLoadGoloModule(SRC, "failure-numeric-trailing-underscore.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException e) {
      assertThat(e.getProblems().size(), is(1));
      Problem problem = e.getProblems().get(0);
      assertThat(problem.getType(), is(PARSING));
    }
  }
View Full Code Here

    try {
      compileAndLoadGoloModule(SRC, "failure-numeric-double-underscore.golo");
      fail("A GoloCompilationException was expected");
    } catch (GoloCompilationException e) {
      assertThat(e.getProblems().size(), is(1));
      Problem problem = e.getProblems().get(0);
      assertThat(problem.getType(), is(PARSING));
    }
  }
View Full Code Here

TOP

Related Classes of fr.insalyon.citi.golo.compiler.GoloCompilationException.Problem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.