Warning: This component is not published. It is part of module implementation. Client module should not use this feature.
6263646566676869707172
sb.append((char) c); c = scanner.read(); } while (c != ICharacterScanner.EOF && isWordPart((char) c)); scanner.unread(); IToken token = keyWords.get(sb.toString()); if (token != null) return token; return bsvc.T_DEFAULT; } scanner.unread();
55565758596061626364
@Test public void noChar() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("aa"); final IToken tk = rule.evaluate(scanner); assertEquals(Token.UNDEFINED, tk); assertEquals("aa", scanner.getCurrentContent()); assertEquals("", scanner.getScannedContent()); }
65666768697071727374
@Test public void simpleChar() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$z "); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals(" ", scanner.getCurrentContent()); assertEquals("$z", scanner.getScannedContent()); }
75767778798081828384
@Test public void simpleChar_1() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$z"); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals("", scanner.getCurrentContent()); assertEquals("$z", scanner.getScannedContent()); }
85868788899091929394
@Test public void escapedChar() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$\\b"); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals("", scanner.getCurrentContent()); assertEquals("$\\b", scanner.getScannedContent()); }
9596979899100101102103104
@Test public void octal_1() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$\\123z "); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals("z ", scanner.getCurrentContent()); assertEquals("$\\123", scanner.getScannedContent()); }
105106107108109110111112113114
@Test public void octal_2() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$\\1z23z "); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals("z23z ", scanner.getCurrentContent()); assertEquals("$\\1", scanner.getScannedContent()); }
115116117118119120121122123124
@Test public void octal_3() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$\\12"); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals("", scanner.getCurrentContent()); assertEquals("$\\12", scanner.getScannedContent()); }
125126127128129130131132133134
@Test public void hex_1() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$\\x123z "); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals("3z ", scanner.getCurrentContent()); assertEquals("$\\x12", scanner.getScannedContent()); }
135136137138139140141142143144
@Test public void hex_2() { final ErlangCharRule rule = new ErlangCharRule(token); scanner = new StringCharacterScanner("$\\x{cFE1}23z "); final IToken tk = rule.evaluate(scanner); assertEquals(token, tk); assertEquals("23z ", scanner.getCurrentContent()); assertEquals("$\\x{cFE1}", scanner.getScannedContent()); }