-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: mbwhite <whitemat@uk.ibm.com>
- Loading branch information
Showing
8 changed files
with
104,529 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: Task-without-params | ||
name: Task_without-params | ||
spec: | ||
params: [] | ||
steps: | ||
- name: ls-build-sources | ||
- name: ls-build_sources | ||
command: ["ls", "-ltr", "/workspace/source/$(params.contextDir)"] | ||
image: busybox | ||
workingDir: /workspace/source/$(params.contextDir) | ||
workspaces: | ||
- description: The git repo will be cloned onto the volume backing this workspace | ||
name: source | ||
name: source |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { KeyComparator } from './tree.js'; | ||
|
||
export class IndexRange implements KeyComparator { | ||
public start: number; | ||
public end: number; | ||
|
||
constructor(start: number, end?: number) { | ||
this.start = start; | ||
this.end = end ? end : start; | ||
} | ||
public isQuery() { | ||
return this.start == this.end; | ||
} | ||
|
||
public toString(): string { | ||
return `[${this.start}-${this.end}]`; | ||
} | ||
|
||
public compare(other: IndexRange): number { | ||
if (this.isQuery()) { | ||
if (this.start >= other.start && this.start <= other.end) { | ||
return 0; | ||
} | ||
} | ||
|
||
if (other.isQuery()) { | ||
if (other.start >= this.start && other.start <= this.end) { | ||
return 0; | ||
} | ||
} | ||
|
||
if (this.start > other.end) { | ||
// goes to the right as larger | ||
return 1; | ||
} else if (this.end <= other.start) { | ||
return -1; | ||
} | ||
|
||
// which should in theory never happen | ||
return 0; | ||
} | ||
|
||
isEqual(key: IndexRange): boolean { | ||
return this.compare(key) === 0; | ||
} | ||
|
||
isGreater(key: IndexRange): boolean { | ||
return this.compare(key) > 0; | ||
} | ||
|
||
isLesser(key: IndexRange): boolean { | ||
return this.compare(key) < 0; | ||
} | ||
} | ||
|
||
export class Result { | ||
public lineNumber: number; | ||
public columnOffset: number; | ||
|
||
constructor(lineNumber: number, columnOffset: number) { | ||
this.lineNumber = lineNumber; | ||
this.columnOffset = columnOffset; | ||
} | ||
|
||
public isEqual(r: Result): boolean { | ||
return this.lineNumber == r.lineNumber && this.columnOffset == r.columnOffset; | ||
} | ||
|
||
public toString(): string { | ||
return `Ln ${this.lineNumber} Col ${this.columnOffset}`; | ||
} | ||
} | ||
|
||
export class LineNode { | ||
public indexRange: IndexRange; | ||
public value: number; | ||
|
||
constructor(indexRange, value: number) { | ||
this.indexRange = indexRange; | ||
this.value = value; | ||
} | ||
|
||
public isQuery() { | ||
return this.indexRange.isQuery(); | ||
} | ||
|
||
public compare(other: LineNode): number { | ||
return this.indexRange.compare(other.indexRange); | ||
} | ||
|
||
public toString(): string { | ||
return `${this.indexRange} @ ${this.value}`; | ||
} | ||
} |
Oops, something went wrong.