Conversation
ottergottaott
left a comment
There was a problem hiding this comment.
нет комментариев, совсем
7 баллов
| ; | ||
|
|
||
| assignment : name=WORD '=' value=WORD #wordAssignment | ||
| | name=WORD '=' '$' value=WORD #variableAssignment |
There was a problem hiding this comment.
Странно, что присваивать можно только WORD и $WORD, а как же строки в кавычках?
| String noQuotes = dqstr.substring(1, dqstr.length() - 1); | ||
|
|
||
| for (Map.Entry<String, String> entry : Environment.values.entrySet()) { | ||
| if (noQuotes.contains("$"+entry.getKey())) { |
| String noQuotes = dqstr.substring(1, dqstr.length() - 1); | ||
|
|
||
| for (Map.Entry<String, String> entry : Environment.values.entrySet()) { | ||
| if (noQuotes.contains("$"+entry.getKey())) { |
| @Test | ||
| public void testSimpleEcho() { | ||
| String expected = "hello\n"; | ||
| String actual = Bash.runExternal("echo hello"); |
There was a problem hiding this comment.
Это интеграционные тесты, нужно ещё юнит-тесты писать
| @Test | ||
| public void testSimpleEcho() { | ||
| String expected = "hello\n"; | ||
| String actual = Bash.runExternal("echo hello"); |
There was a problem hiding this comment.
Это интеграционные тесты, нужно ещё юнит-тесты писать
| String interpret(BashNode node) throws Exception { | ||
| if (node != null) { | ||
| if (node instanceof BashPipeline) { | ||
| result = interpret(((BashPipeline) node).left()); |
There was a problem hiding this comment.
Тут бы хорошо подошёл switch, для этого значение какого-то enum лучше держать
| try { | ||
| result = interpreter.interpret(rootNodeGood); | ||
| } catch (Exception e) { | ||
| // e.printStackTrace(); for debug |
There was a problem hiding this comment.
Не должно быть закомментированного кода
| try { | ||
| result = interpreter.interpret(rootNodeGood); | ||
| } catch (Exception e) { | ||
| // e.printStackTrace(); for debug |
There was a problem hiding this comment.
Не должно быть закомментированного кода
| result = interpreter.interpret(rootNodeGood); | ||
| } catch (Exception e) { | ||
| // e.printStackTrace(); for debug | ||
| result = e + "\n"; |
There was a problem hiding this comment.
А почему игнорируется исключение и тупо stdout пишется?
| result = interpreter.interpret(rootNodeGood); | ||
| } catch (Exception e) { | ||
| // e.printStackTrace(); for debug | ||
| result = e + "\n"; |
There was a problem hiding this comment.
А почему игнорируется исключение и тупо stdout пишется?
No description provided.