Examples of SourcePosition


Examples of com.google.gxp.compiler.alerts.SourcePosition

/**
* Tests of serializability.
*/
public class SerializabilityTest extends GxpcTestCase {
  public void testCallables() throws Exception {
    SourcePosition pos = pos();

    Template template1 = template(pos, "com.google.foo.Bar", schema("text/html"),
                                  Collections.<Import>emptyList(),
                                  Collections.<ThrowsDeclaration>emptyList(),
                                  Collections.<Parameter>emptyList(),
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

    assertSerializes(schema("text/css"),   schema("text/css"));
    assertSerializes(schema("text/html"),  schema("text/html"));
  }

  public void testTypes() throws Exception {
    SourcePosition pos = pos();

    assertSerializes(booleanType(pos),
                     booleanType(pos));

    assertSerializes(bundleType(pos, schema("text/html"), "div", "class"),
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

      super(out, alertSink, template);
      this.extraIncludess = ImmutableSet.copyOf(extraIncludess);
    }

    protected void appendClass() {
      SourcePosition pos = template.getSourcePosition();
      TemplateName templateName = template.getName();

      appendIfdefGuardStart(template);
      appendLine();
      appendLine("#include \"gxp/base/base.h\"");
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

      appendLine();
      appendIfdefGuardEnd(template);
    }

    protected void appendExtraWriteMethods(boolean isStatic) {
      SourcePosition pos = template.getSourcePosition();
      Iterable<Parameter> params = isStatic
          ? template.getAllParameters()
          : template.getParameters();

      for (ExtraOutType extraOutType : extraOutTypes) {
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

        appendLine("}");
      }
    }

    protected void appendInterface() {
      SourcePosition pos = template.getSourcePosition();

      appendLine("//");
      appendLine("// Interface that defines a strategy for writing this GXP");
      appendLine("//");
      appendCppFormalTypeParameters(true, template.getFormalTypeParameters());
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

    protected void appendInstance() {
      StringBuilder sb;
      Constructor constructor = template.getConstructor();
      List<Parameter> cParams = constructor.getParameters();
      SourcePosition pos = constructor.getSourcePosition();

      appendLine("//");
      appendLine("// Instantiable instance of this GXP");
      appendLine("//");
      appendCppFormalTypeParameters(true, template.getFormalTypeParameters());
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

  public void testCall_nonEmptyNonContainer() throws Exception {
    String startCall = "<my:" + getTemplateBaseName() + ">";
    String endCall = "</my:" + getTemplateBaseName() + ">";
    compile(startCall + "stuff inside" + endCall);
    SourcePosition errorPos = pos(2, endCall.length());
    assertAlert(new BadNodePlacementError(errorPos, "text",
                                          "inside " + startCall));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

        tcMessageBuilder.setDescription(msg.getComment());
      }

      // - Include the source gxp file so that l10n experts for other projects
      //   can avoid clobbering this project's translated strings.
      SourcePosition source = msg.getSourcePosition();
      if (source != null) {
        tcMessageBuilder.addSource(source.getSource().toRelativeFilename()
                                   + ": L" + source.getLine()
                                   // For backwards compatibility with the old
                                   // compiler, report a 0-based column number.
                                   + ", C" + (source.getColumn() - 1));
      }
    }
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

    for (String legalExpr : LEGAL_EXPRESSIONS) {
      compile(prefix + CharEscapers.xmlEscaper().escape(legalExpr) + suffix);
      assertNoUnexpectedAlerts();
    }

    SourcePosition errorPos = pos(errorLine, errorColumn);

    for (IllegalOperatorExpression illegalOp : ILLEGAL_OPERATORS) {
      compile(prefix + CharEscapers.xmlEscaper().escape(illegalOp.getExpression()) + suffix);
      for (OutputLanguage outputLanguage : illegalOp.getOutputLanguages()) {
        assertAlert(new IllegalOperatorError(errorPos, outputLanguage.getDisplay(),
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

      assertNoUnexpectedAlerts();
    }

    for (String illegalName : ILLEGAL_VAR_NAMES) {
      compile(prefix + CharEscapers.xmlEscaper().escape(illegalName) + suffix);
      SourcePosition errorPos = pos(2, 1);
      assertAlert(new IllegalVariableNameError(errorPos, illegalName));
      assertNoUnexpectedAlerts();
    }

    for (Map.Entry<String, Collection<OutputLanguage>> illegalName :
             ILLEGAL_OUTPUT_LANGUAGE_NAMES.entrySet()) {
      compile(prefix + CharEscapers.xmlEscaper().escape(illegalName.getKey()) + suffix);
      SourcePosition errorPos = pos(2, 1);
      for (OutputLanguage outputLanguage : illegalName.getValue()) {
        assertAlert(new IllegalNameError(errorPos, outputLanguage.getDisplay(),
                                         illegalName.getKey()));
      }
      assertNoUnexpectedAlerts();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.