thrownewParseException("Impossible to test whether NULL is a valid ADQL regular identifier!");
elseif(!isRegularIdentifier(token.image))
thrownewParseException("Invalid ADQL regular identifier: \u005c"" + token.image + "\u005c"! If it aims to be a column/table name/alias, you should write it between double quotes.",newTextPosition(token));
fail("Hexadecimal values should not be allowed with ADQL-2.0!");
}catch(Exceptionex){
assertEquals(ParseException.class,ex.getClass());
assertEquals("Invalid ADQL regular identifier: \"0xF\"! HINT: hexadecimal values are not supported in ADQL-2.0. You should change the grammar version of the ADQL parser to at least ADQL-2.1.",ex.getMessage());
}
// CASE: Hexadecimal allowed in ADQL-2.1
parser=newADQLParser(ADQLVersion.V2_1);
try{
assertEquals("SELECT 0xF\nFROM foo",parser.parseQuery("SELECT 0xF FROM foo").toADQL());
assertEquals("SELECT 0xF*2\nFROM foo",parser.parseQuery("SELECT 0xF*2 FROM foo").toADQL());
assertEquals("SELECT -0xF\nFROM foo",parser.parseQuery("SELECT -0xF FROM foo").toADQL());
}catch(Exceptionex){
ex.printStackTrace();
fail("Unexpected error with valid hexadecimal values! (see console for more details)");