MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / op_left_class

Function op_left_class

codegraph-kernel/grammars/scala/scanner.c:283–295  ·  view source on GitHub ↗

SLS 6.12.3 gives an operator its precedence by its first character. An operator ending in `/` is never right-associative and never an assignment, so the left-associative class is the whole answer. The partition matches OP_TOKEN in grammar.js, whose first-character sets it has to agree with. `/` is absent because is_op_char rejects it, so no caller can pass one.

Source from the content-addressed store, hash-verified

281// OP_TOKEN in grammar.js, whose first-character sets it has to agree with.
282// `/` is absent because is_op_char rejects it, so no caller can pass one.
283static enum TokenType op_left_class(int32_t first) {
284 switch (first) {
285 case '|': return OP_LEFT_OR;
286 case '^': return OP_LEFT_XOR;
287 case '&': return OP_LEFT_AND;
288 case '=': case '!': return OP_LEFT_EQ;
289 case '<': case '>': return OP_LEFT_REL;
290 case ':': return OP_LEFT_COLON;
291 case '+': case '-': return OP_LEFT_ADD;
292 case '*': case '%': return OP_LEFT_MUL;
293 default: return OP_LEFT_OTHER;
294 }
295}
296
297// Mirrors the start class of XML_NAME in grammar.js. Every non-ASCII
298// character is accepted, since the letter test is ASCII-only and the internal

Callers 1

scan_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected