MCPcopy Index your code
hub / github.com/antlr/antlr4 / reduce

Method reduce

runtime/JavaScript/src/antlr4/misc/IntervalSet.js:68–82  ·  view source on GitHub ↗
(pos)

Source from the content-addressed store, hash-verified

66 }
67
68 reduce(pos) {
69 // only need to reduce if pos is not the last
70 if (pos < this.intervals.length - 1) {
71 const current = this.intervals[pos];
72 const next = this.intervals[pos + 1];
73 // if next contained in current
74 if (current.stop >= next.stop) {
75 this.intervals.splice(pos + 1, 1);
76 this.reduce(pos);
77 } else if (current.stop >= next.start) {
78 this.intervals[pos] = new Interval(current.start, next.stop);
79 this.intervals.splice(pos + 1, 1);
80 }
81 }
82 }
83
84 complement(start, stop) {
85 const result = new IntervalSet();

Callers 5

addIntervalMethod · 0.95
getTokenTypeMapMethod · 0.45
getRuleIndexMapMethod · 0.45
lengthMethod · 0.45
lengthMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected