Browse Source

small formatting

Herbert Vojčík 9 years ago
parent
commit
b6f8817503
2 changed files with 7 additions and 7 deletions
  1. 2 2
      support/parser.js
  2. 5 5
      support/parser.pegjs

+ 2 - 2
support/parser.js

@@ -108,7 +108,7 @@ globals.SmalltalkParser = (function() {
         peg$c51 = ".",
         peg$c52 = { type: "literal", value: ".", description: "\".\"" },
         peg$c53 = function(neg, digits, dec) {return parseFloat(((neg || '') + digits.join("") + "." + dec.join("")), 10);},
-        peg$c54 = function(neg, digits) {return (parseInt((neg || '') +digits.join(""), 10));},
+        peg$c54 = function(neg, digits) {return (parseInt((neg || '') + digits.join(""), 10));},
         peg$c55 = "#(",
         peg$c56 = { type: "literal", value: "#(", description: "\"#(\"" },
         peg$c57 = "(",
@@ -161,7 +161,7 @@ globals.SmalltalkParser = (function() {
                                     ._source_(text())
                                     ._value_(identifier);
                          },
-        peg$c82 = function(key, arg) {return {key:key, arg: arg};},
+        peg$c82 = function(key, arg) {return {key:key, arg:arg};},
         peg$c83 = /^[\\+*\/=><,@%~|&\-]/,
         peg$c84 = { type: "class", value: "[\\\\+*\\/=><,@%~|&\\-]", description: "[\\\\+*\\/=><,@%~|&\\-]" },
         peg$c85 = function(bin) {return bin.join("");},

+ 5 - 5
support/parser.pegjs

@@ -36,8 +36,8 @@ number         = n:(numberExp / hex / float / integer) {
                  }
 numberExp      = n:((float / integer) "e" integer) {return parseFloat(n.join(""));}
 hex            = neg:"-"? "16r" num:[0-9a-fA-F]+ {return parseInt(((neg || '') + num.join("")), 16);}
-float          = neg:"-"?digits:[0-9]+ "." dec:[0-9]+ {return parseFloat(((neg || '') + digits.join("") + "." + dec.join("")), 10);}
-integer        = neg:"-"?digits:[0-9]+ {return (parseInt((neg || '') +digits.join(""), 10));}
+float          = neg:"-"? digits:[0-9]+ "." dec:[0-9]+ {return parseFloat(((neg || '') + digits.join("") + "." + dec.join("")), 10);}
+integer        = neg:"-"? digits:[0-9]+ {return (parseInt((neg || '') + digits.join(""), 10));}
 
 literalArray   = "#(" rest:literalArrayRest {return rest;}
 bareLiteralArray   = "(" rest:literalArrayRest {return rest;}
@@ -53,7 +53,7 @@ dynamicArray   = "{" ws expressions:expressions? ws "."? "}" {
                             ._source_(text())
                             ._nodes_(expressions || []);
                  }
-dynamicDictionary = "#{" ws expressions: associations? ws "}" {
+dynamicDictionary = "#{" ws expressions:associations? ws "}" {
                         return globals.DynamicDictionaryNode._new()
                                ._position_((line()).__at(column()))
                                ._source_(text())
@@ -82,12 +82,12 @@ variable       = identifier:identifier {
 
 reference      = variable
 
-keywordPair    = ws key:keyword ws arg:binarySend {return {key:key, arg: arg};}
+keywordPair    = ws key:keyword ws arg:binarySend {return {key:key, arg:arg};}
 
 binarySelector = bin:[\\+*/=><,@%~|&-]+ {return bin.join("");}
 unarySelector  = identifier
 
-keywordPattern = pairs:(ws key:keyword ws arg:identifier {return {key:key, arg: arg};})+ {
+keywordPattern = pairs:(ws key:keyword ws arg:identifier {return {key:key, arg:arg};})+ {
                      var keywords = [];
                      var params = [];
                      var i = 0;