Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

resolve a few other issues, appears to deploy happily now...

  • Loading branch information...
commit 30f5224a4c7b820b35234b52f77131567bc5fad4 1 parent 2b6dee6
@sanity authored
View
23 src/com/lastcalc/parsers/UserDefinedParserParser.java
@@ -2,15 +2,15 @@
* LastCalc - The last calculator you'll ever need
* Copyright (C) 2011, 2012 Uprizer Labs LLC
*
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Affero General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Affero General Public License for more
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Affero General Public License for more
* details.
******************************************************************************/
package com.lastcalc.parsers;
@@ -218,7 +218,10 @@ public ParseResult parse(final TokenList tokens, final int templatePos, final Pa
return ParseResult.fail();
final List<Object> result = Lists.newArrayListWithCapacity(after.size() + 2);
- result.add("(");
+ final boolean useBrackets = tokens.size() > template.size();
+ if (useBrackets) {
+ result.add("(");
+ }
final TokenList input = tokens.subList(templatePos, templatePos + template.size());
final Map<String, Object> varMap = Maps.newHashMapWithExpectedSize(variables.size());
try {
@@ -234,7 +237,9 @@ public ParseResult parse(final TokenList tokens, final int templatePos, final Pa
} catch (final BindException e) {
return ParseResult.fail();
}
- result.add(")");
+ if (useBrackets) {
+ result.add(")");
+ }
final TokenList resultTL = TokenList.create(result);
final TokenList flattened = PreParser.flatten(resultTL);
return ParseResult.success(
View
15 war/WEB-INF/appengine-web.xml
@@ -1,19 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- LastCalc - The last calculator you'll ever need
- Copyright (C) 2011, 2012 Uprizer Labs LLC
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the GNU Affero General Public License for more
- details.
--->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>lastcalc-upr</application>
<version>1</version>
View
15 war/WEB-INF/datastore-indexes.xml
@@ -1,19 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- LastCalc - The last calculator you'll ever need
- Copyright (C) 2011, 2012 Uprizer Labs LLC
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the GNU Affero General Public License for more
- details.
--->
<datastore-indexes autoGenerate="true">
<datastore-index kind="Worksheet" ancestor="false"
source="auto">
View
15 war/WEB-INF/logging.properties
@@ -1,18 +1,3 @@
-#-------------------------------------------------------------------------------
-# LastCalc - The last calculator you'll ever need
-# Copyright (C) 2011, 2012 Uprizer Labs LLC
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU Affero General Public License for more
-# details.
-#-------------------------------------------------------------------------------
# A default java.util.logging configuration.
# (All App Engine logging is through java.util.logging by default).
#
View
15 war/WEB-INF/web.xml
@@ -1,19 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- LastCalc - The last calculator you'll ever need
- Copyright (C) 2011, 2012 Uprizer Labs LLC
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the GNU Affero General Public License for more
- details.
--->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
View
15 war/noie.html
@@ -1,18 +1,3 @@
-#-------------------------------------------------------------------------------
-# LastCalc - The last calculator you'll ever need
-# Copyright (C) 2011, 2012 Uprizer Labs LLC
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU Affero General Public License for more
-# details.
-#-------------------------------------------------------------------------------
<html>
<head>
<title>LastCalc: Your browser is not supported :-(</title>
Please sign in to comment.
Something went wrong with that request. Please try again.