diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-02-22 18:37:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-22 18:37:43 +0100 |
| commit | a9d943e2d93be0e741874cb1ef85488dacc6eeab (patch) | |
| tree | e6591f07da1455d170d5c20c1f49beeeefcd5bbd /src/compiler.rs | |
| parent | 02bb836d9a9261b0ba9eb5ef6a9f02cc3605b672 (diff) | |
| parent | 7b2dd8497967bb2a78f7ff2055a4976a9bb2a4e5 (diff) | |
| download | sylt-a9d943e2d93be0e741874cb1ef85488dacc6eeab.tar.gz | |
Merge pull request #87 from FredTheDino/conflict-markers
Detect conflict markers
Diffstat (limited to 'src/compiler.rs')
| -rw-r--r-- | src/compiler.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler.rs b/src/compiler.rs index cd4ffda..124606e 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -473,6 +473,18 @@ impl Compiler { fn eat(&mut self) -> Token { let t = self.peek(); self.curr += 1; + match t { + Token::GitConflictBegin => { + self.curr -= 1; + let start = self.line(); + self.curr += 1; + while !matches!(self.eat(), Token::GitConflictEnd) {} + self.panic = false; + self.error_on_line(ErrorKind::GitConflictError(start, self.line()), start, None); + self.panic = true; + } + _ => {} + } t } |
