MCPcopy Create free account
hub / github.com/BaseXdb/basex / unary

Method unary

basex-core/src/main/java/org/basex/query/QueryParser.java:2066–2079  ·  view source on GitHub ↗

Parses the "UnaryExpr" rule. @return query expression or null @throws QueryException query exception

()

Source from the content-addressed store, hash-verified

2064 * @throws QueryException query exception
2065 */
2066 private Expr unary() throws QueryException {
2067 boolean minus = false, found = false;
2068 while(true) {
2069 skipWs();
2070 if(next() != '>' && consume('-')) {
2071 minus ^= true;
2072 } else if(consume('+')) {
2073 } else {
2074 final Expr expr = value();
2075 return found ? new Unary(info(), check(expr, EVALUNARY), minus) : expr;
2076 }
2077 found = true;
2078 }
2079 }
2080
2081 /**
2082 * Parses the "ValueExpr" rule.

Callers 1

arrowMethod · 0.95

Calls 6

skipWsMethod · 0.95
valueMethod · 0.95
infoMethod · 0.95
checkMethod · 0.95
nextMethod · 0.65
consumeMethod · 0.45

Tested by

no test coverage detected