Commit 994a3006 by Arthur Schreiber

Update the javascript diff driver's function pattern.

parent 19fa9c0c
......@@ -191,9 +191,9 @@ PATTERNS("php",
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
PATTERNS("javascript",
"^[ \t]*(function[ \t][a-zA-Z_][^\\{]*)\n"
"^[ \t]*(var[ \t]+[a-zA-Z_][a-zA-Z0-9_]*[ \t]*=[ \t]*function[ \t\\(][^\\{]*)\n"
"^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*[ \t]*:[ \t]*function[ \t\\(][^\\{]*)",
"([a-zA-Z_$][a-zA-Z0-9_$]*(\\.[a-zA-Z0-9_$]+)*[ \t]*=[ \t]*function([ \t][a-zA-Z_$][a-zA-Z0-9_$]*)?[^\\{]*)\n"
"([a-zA-Z_$][a-zA-Z0-9_$]*[ \t]*:[ \t]*function([ \t][a-zA-Z_$][a-zA-Z0-9_$]*)?[^\\{]*)\n"
"[^a-zA-Z0-9_\\$](function([ \t][a-zA-Z_$][a-zA-Z0-9_$]*)?[^\\{]*)",
/* -- */
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+[fFlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
......
......@@ -2,7 +2,7 @@ diff --git a/files/file.javascript b/files/file.javascript
index 0965b37..5391797 100644
--- a/files/file.javascript
+++ b/files/file.javascript
@@ -4,4 +4,3 @@
@@ -4,4 +4,3 @@ function(require, exports, module)
var Key = require("./key")
- , Direction = require("./direction")
- , Image = require("./image");
......@@ -15,12 +15,12 @@ index 0965b37..5391797 100644
+ this.pixelX = 10;
+ this.pixelY = 10;
@@ -82,3 +81,3 @@ function Player(game)
@@ -82,3 +81,3 @@ Player.prototype.moveUp = function()
Player.prototype.moveLeft = function() {
- this.x -= 1;
+ this.x -= 5;
this.direction = Direction.LEFT;
@@ -106,3 +105,3 @@ function Player(game)
@@ -106,3 +105,3 @@ Player.prototype.draw = function(context)
- context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY - 16, 32, 48);
+ context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY, 32, 48);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment