Skip to content

Commit

Permalink
make friendship with Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyPopovkin committed Dec 19, 2016
1 parent 8c9cb17 commit 482153d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ru.mipt.java2016.homework.g595.popovkin.task1;

import org.w3c.dom.DOMImplementation;
import ru.mipt.java2016.homework.base.task1.ParsingException;

import java.util.List;
Expand Down Expand Up @@ -50,9 +49,13 @@ boolean isMathSign() {
return type == UnitType.MathSign;
}

boolean isFunc() { return type == UnitType.Function; }
boolean isFunc() {
return type == UnitType.Function;
}

boolean isComma() { return type == UnitType.Comma; }
boolean isComma() {
return type == UnitType.Comma;
}

LexicalUnit(String val) throws ParsingException {
value = val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import ru.mipt.java2016.homework.base.task1.*;

import javax.naming.LimitExceededException;
import java.util.*;

/**
Expand Down Expand Up @@ -90,8 +89,12 @@ private double parceAndCalc(int leftId, int rightId) throws ParsingException {
int lastPoint = leftId + 2;
int balance = 0;
while (commaScaner < rightId - 1) {
if (lexicalUnits.get(commaScaner).isOpenBracer()) ++balance;
else if (lexicalUnits.get(commaScaner).isCloseBracer()) --balance;
if (lexicalUnits.get(commaScaner).isOpenBracer()) {
++balance;
}
else if (lexicalUnits.get(commaScaner).isCloseBracer()) {
--balance;
}
else if (lexicalUnits.get(commaScaner).isComma() && balance == 0) {
//System.out.print(lastPoint);
//System.out.println(commaScaner);
Expand All @@ -100,8 +103,9 @@ else if (lexicalUnits.get(commaScaner).isComma() && balance == 0) {
}
++commaScaner;
}
if (lastPoint != commaScaner)
if (lastPoint != commaScaner) {
argv.add(parceAndCalc(lastPoint, commaScaner));
}
return unit.eval(argv);
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@RestController
public class ExampleHandler {
MyCalculator calculator = new MyCalculator();
private MyCalculator calculator = new MyCalculator();

@RequestMapping(value = "/{expression}", method = RequestMethod.GET)
public ResponseEntity<String> eval(@PathVariable String expression) {
Expand All @@ -34,6 +34,7 @@ public ResponseEntity<String> eval(@PathVariable String expression) {
+ "</p></body>", HttpStatus.OK);
return resp;
}

@RequestMapping(value = "/put/{name}", method = RequestMethod.PUT)
public ResponseEntity<String> put(@RequestParam(value = "args", defaultValue = "x") List<String> vars,
@PathVariable String name, @RequestBody String body) {
Expand Down

0 comments on commit 482153d

Please sign in to comment.