PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: goby-lang/goby (go)

Issue:
Positive unary operator like `+1` unhandled
When fixing #526, I also found that the positive unary operator like `+1` are treated as invalid:

```ruby
» -1
#» -1
» +1
unexpected + Line: 0
» +1
```

I'd like to fix this as well when fixing #526 and then close this issue.

Pull request:
Fix #555
This closes #555 

Patch:
diff --git a/compiler/bytecode/expression_generation.go b/compiler/bytecode/expression_generation.go
index 057b022..69b3b9f 100644
--- a/compiler/bytecode/expression_generation.go
+++ b/compiler/bytecode/expression_generation.go
@@ -244,6 +244,8 @@ func (g *Generator) compilePrefixExpression(is *InstructionSet, exp *ast.PrefixE
 		is.define(PutObject, exp.Line(), 0)
 		g.compileExpression(is, exp.Right, scope, table)
 		is.define(Send, exp.Line(), exp.Operator, 1, "", &ArgSet{})
+	case "+":
+		g.compileExpression(is, exp.Right, scope, table)
 	}
 }
 
diff --git a/compiler/parser/parser.go b/compiler/parser/parser.go
index 3e3693a..6ed4441 100644
--- a/compiler/parser/parser.go
+++ b/compiler/parser/parser.go
@@ -70,6 +70,7 @@ func New(l *lexer.Lexer) *Parser {
 	p.registerPrefix(token.False, p.parseBooleanLiteral)
 	p.registerPrefix(token.Null, p.parseNilExpression)
 	p.registerPrefix(token.Minus, p.parsePrefixExpression)
+	p.registerPrefix(token.Plus, p.parsePrefixExpression)
 	p.registerPrefix(token.Asterisk, p.parsePrefixExpression)
 	p.registerPrefix(token.Bang, p.parsePrefixExpression)
 	p.registerPrefix(token.LParen, p.parseGroupedExpression)


Test patch:
diff --git a/compiler/parser/expression_parsing_test.go b/compiler/parser/expression_parsing_test.go
index 84b4171..e44a034 100644
--- a/compiler/parser/expression_parsing_test.go
+++ b/compiler/parser/expression_parsing_test.go
@@ -698,7 +698,8 @@ func TestArithmeticExpressionFail(t *testing.T) {
 		input string
 		error string
 	}{
-		{`{ 1 ++ 1 }`, `unexpected + Line: 0`},
+		{`{ 1 ++ 1 }`, `expected next token to be }, got +(+) instead. Line: 0`},
+		{`{ 1 -- 1 }`, `expected next token to be }, got -(-) instead. Line: 0`},
 		{`{ 1 * * 1 }`, `unexpected * Line: 0`},
 		{`{ 1 ** [1, 2] }`, `expected next token to be }, got **(**) instead. Line: 0`},
 	}
diff --git a/vm/evaluation_test.go b/vm/evaluation_test.go
index e6c6dd9..d2369a9 100644
--- a/vm/evaluation_test.go
+++ b/vm/evaluation_test.go
@@ -2242,6 +2242,26 @@ func TestMinusPrefixMethodCall(t *testing.T) {
 	}
 }
 
+func TestPlusPrefixMethodCall(t *testing.T) {
+	tests := []struct {
+		input    string
+		expected int
+	}{
+		{"+5", 5},
+		{"+10", 10},
+		{"+(-10)", -10},
+		{"+(-5)", -5},
+	}
+
+	for i, tt := range tests {
+		v := initTestVM()
+		evaluated := v.testEval(t, tt.input, getFilename())
+		VerifyExpected(t, i, evaluated, tt.expected)
+		v.checkCFP(t, i, 0)
+		v.checkSP(t, i, 1)
+	}
+}
+
 func TestMultiVarAssignment(t *testing.T) {
 	tests := []struct {
 		input    string
Repository: vuejs/composition-api (ts)

Issue:
Warnings In Tests When Using createLocalVue() From vue-test-utils
When using any of the 1.0.0 betas, a lot of warnings get printed during tests. This is caused by code like this:

```ts
import VueCompositionAPI from "@vue/composition-api";
import { createLocalVue } from "@vue/test-utils";
import range from "lodash/range";
import { VueConstructor } from "vue";

describe("warnings", () => {
  let localVue: VueConstructor;

  beforeEach(() => {
    localVue = createLocalVue();
    localVue.use(VueCompositionAPI);
  });

  test.each(range(5))("create localVue 5 times", () => {
    expect(localVue).toBeDefined();
  });
});

```
The printed warning will look like this:
```
 [Vue warn]: Another instance of vue installed
```

Is there anything that could be done to silence those warnings? The issue seems to be related to https://github.com/vuejs/composition-api/issues/492

Pull request:
fix(vue-test): prevent warning when using multiple `localVue`
fix #530 

Patch:
diff --git a/src/runtimeContext.ts b/src/runtimeContext.ts
index 4535be1..e718eb5 100644
--- a/src/runtimeContext.ts
+++ b/src/runtimeContext.ts
@@ -46,7 +46,8 @@ export function getRegisteredVueOrDefault(): VueConstructor {
 }
 
 export function setVueConstructor(Vue: VueConstructor) {
-  if (__DEV__ && vueConstructor) {
+  // @ts-ignore
+  if (__DEV__ && vueConstructor && Vue.__proto__ !== vueConstructor.__proto__) {
     warn('Another instance of vue installed')
   }
   vueConstructor = Vue


Test patch:
diff --git a/test/use.spec.ts b/test/use.spec.ts
index da2043c..8e02921 100644
--- a/test/use.spec.ts
+++ b/test/use.spec.ts
@@ -1,3 +1,4 @@
+import Vue from 'vue'
 import CompositionApi from '../src'
 import { createLocalVue } from './helpers/create-local-vue'
 import { mockWarn } from './helpers'
@@ -12,7 +13,26 @@ describe('use', () => {
     const localVueTwo = createLocalVue()
     localVueTwo.use(CompositionApi)
 
-    expect('Another instance of vue installed').toHaveBeenWarned()
+    expect('Another instance of vue installed').not.toHaveBeenWarned()
+  })
+
+  it('should warn install in multiple vue', () => {
+    try {
+      const fakeVue = {
+        version: '2._.x',
+        config: {
+          optionMergeStrategies: {},
+        },
+        mixin: jest.fn(),
+      }
+
+      // @ts-ignore
+      CompositionApi.install(fakeVue)
+      expect('Another instance of vue installed').toHaveBeenWarned()
+    } finally {
+      Vue.use(CompositionApi)
+      expect('Another instance of vue installed').toHaveBeenWarned()
+    }
   })
 
   it('should warn installing multiple times', () => {
@@ -29,7 +49,5 @@ describe('use', () => {
     }).toThrowError(
       'already installed. Vue.use(VueCompositionAPI) should be called only once.'
     )
-
-    expect('Another instance of vue installed').toHaveBeenWarned()
   })
 })
Repository: aantron/lambdasoup (ocaml)

Issue:

Pull request:
Add `Soup.prepend_root`
There's `Soup.append_root` but there's no `Soup.prepend_root`, and without it, inserting something before the very first node in a soup seems impossible.

This patch fixes that and also adds a test for append/prepend root functions specifically.

Patch:
diff --git a/src/soup.ml b/src/soup.ml
index 96b6502..84e8b31 100644
--- a/src/soup.ml
+++ b/src/soup.ml
@@ -1195,6 +1195,11 @@ let append_root document node =
   mutate_child_list (fun f -> f @ [forget_type node]) document;
   node.parent <- Some document
 
+let prepend_root document node =
+  delete node;
+  mutate_child_list (fun f -> (forget_type node)::f) document;
+  node.parent <- Some document
+
 let set_name new_name = function
   | {values = `Element e; _} ->
     e.name <- new_name |> String.trim |> String.lowercase_ascii
diff --git a/src/soup.mli b/src/soup.mli
index f36c376..3ed4e8e 100644
--- a/src/soup.mli
+++ b/src/soup.mli
@@ -636,6 +636,9 @@ val unwrap : (_ node) -> unit
 val append_root : soup node -> (_ node) -> unit
 (** [append_root soup node] adds [node] as the last root node of [soup]. *)
 
+val prepend_root : soup node -> (_ node) -> unit
+(** [prepend_root soup node] adds [node] as the first root node of [soup]. *)
+
 val set_name : string -> element node -> unit
 (** Sets the tag name of the given element. *)
 


Test patch:
diff --git a/test/test.ml b/test/test.ml
index 4455f8a..378b9a5 100644
--- a/test/test.ml
+++ b/test/test.ml
@@ -869,6 +869,12 @@ let suites = [
         (element |> texts)
         ["five"; "three"; "four"; "one"; "six"; "two"; "seven"]);
 
+    ("append-prepend-root" >:: fun _ ->
+      let soup = parse "test2" in
+      append_root soup (parse "test3");
+      prepend_root soup (parse "test1");
+      assert_equal (soup |> texts) ["test1"; "test2"; "test3"]);
+
     ("delete" >:: fun _ ->
       let body = page "list" |> parse $ "body" in
       let ul = body $ "ul" in