Ejemplo n.º 1
0
  @Test
  public void testTraditionalComment2() throws Exception {
    Lexer lexer = JavaGrammar.getInstance().getLexer();

    TokenStream tokenStream =
        lexer.lex(new FixedCodeLocation("/* to select the \"client\" VM */").getSourceCode());
    assertEquals(1, tokenStream.size());
    assertEquals(Visibility.IGNORED, tokenStream.get(0).getVisibility());
  }
Ejemplo n.º 2
0
  @Test
  public void testTraditionalComment3() throws Exception {
    Lexer lexer = JavaGrammar.getInstance().getLexer();

    TokenStream tokenStream =
        lexer.lex(
            new FixedCodeLocation(
                    "/*\n"
                        + "* @(#)Activation.java  1.78 10/03/23\n"
                        + "*\n"
                        + "* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.\n"
                        + "* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.\n"
                        + "*/")
                .getSourceCode());
    assertEquals(1, tokenStream.size());
    assertEquals(Visibility.IGNORED, tokenStream.get(0).getVisibility());
  }