From c3f8f5067e49756b64c44b2241963db5b88dc482 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Apr 2010 13:34:26 -0700 Subject: [PATCH] catch merge conflicts in source and report them as such --- basis/debugger/debugger.factor | 3 +++ core/bootstrap/syntax.factor | 6 ++++++ core/parser/parser.factor | 2 ++ core/syntax/syntax.factor | 8 ++++++++ 4 files changed, 19 insertions(+) diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index 8f448ff237..468b5dcf2b 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -306,6 +306,9 @@ M: bad-inheritance summary M: not-in-a-method-error summary drop "call-next-method can only be called in a method definition" ; +M: version-control-merge-conflict summary + drop "Version control merge conflict in source code" ; + GENERIC: expected>string ( obj -- str ) M: f expected>string drop "end of input" ; diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index c13f9f9026..9395447aa6 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -89,6 +89,12 @@ IN: bootstrap.syntax "read-only" "call(" "execute(" + "<<<<<<" + "======" + ">>>>>>" + "<<<<<<<" + "=======" + ">>>>>>>" } [ "syntax" create drop ] each "t" "syntax" lookup define-symbol diff --git a/core/parser/parser.factor b/core/parser/parser.factor index 3257bd69a4..be43979b31 100644 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -207,3 +207,5 @@ print-use-hook [ [ ] ] initialize : ?run-file ( path -- ) dup exists? [ run-file ] [ drop ] if ; + +ERROR: version-control-merge-conflict ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index bd70b0be62..de719c7272 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -257,4 +257,12 @@ IN: bootstrap.syntax "call(" [ \ call-effect parse-call( ] define-core-syntax "execute(" [ \ execute-effect parse-call( ] define-core-syntax + + "<<<<<<<" [ version-control-merge-conflict ] define-core-syntax + "=======" [ version-control-merge-conflict ] define-core-syntax + ">>>>>>>" [ version-control-merge-conflict ] define-core-syntax + + "<<<<<<" [ version-control-merge-conflict ] define-core-syntax + "======" [ version-control-merge-conflict ] define-core-syntax + ">>>>>>" [ version-control-merge-conflict ] define-core-syntax ] with-compilation-unit