|
1 | 1 | package com.igormaznitsa.prologparser; |
2 | 2 |
|
| 3 | +import static com.igormaznitsa.prologparser.DefaultParserContext.of; |
| 4 | +import static com.igormaznitsa.prologparser.ParserContext.FLAG_ALLOW_ZERO_STRUCT; |
| 5 | +import static com.igormaznitsa.prologparser.ParserContext.FLAG_BLOCK_COMMENTS; |
| 6 | +import static com.igormaznitsa.prologparser.ParserContext.FLAG_NONE; |
| 7 | +import static com.igormaznitsa.prologparser.ParserContext.FLAG_VAR_AS_FUNCTOR; |
| 8 | +import static com.igormaznitsa.prologparser.ParserContext.FLAG_ZERO_SINGLE_QUOTATION_CHAR_CODE; |
| 9 | +import static com.igormaznitsa.prologparser.terms.OpContainer.make; |
| 10 | +import static com.igormaznitsa.prologparser.terms.PrologTerm.QuotingType.BACK_QUOTED; |
| 11 | +import static com.igormaznitsa.prologparser.terms.PrologTerm.QuotingType.DOUBLE_QUOTED; |
| 12 | +import static com.igormaznitsa.prologparser.terms.PrologTerm.QuotingType.NO_QUOTED; |
| 13 | +import static com.igormaznitsa.prologparser.terms.PrologTerm.QuotingType.SINGLE_QUOTED; |
| 14 | +import static com.igormaznitsa.prologparser.terms.TermType.ATOM; |
| 15 | +import static com.igormaznitsa.prologparser.tokenizer.OpAssoc.FY; |
| 16 | +import static com.igormaznitsa.prologparser.tokenizer.OpAssoc.XFX; |
| 17 | +import static com.igormaznitsa.prologparser.tokenizer.OpAssoc.XFY; |
| 18 | +import static java.util.stream.Collectors.joining; |
| 19 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 20 | +import static org.junit.jupiter.api.Assertions.assertFalse; |
| 21 | +import static org.junit.jupiter.api.Assertions.assertNotNull; |
| 22 | +import static org.junit.jupiter.api.Assertions.assertNotSame; |
| 23 | +import static org.junit.jupiter.api.Assertions.assertSame; |
| 24 | +import static org.junit.jupiter.api.Assertions.assertThrows; |
| 25 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
| 26 | +import static org.junit.jupiter.api.Assertions.fail; |
| 27 | +import static org.mockito.Mockito.clearInvocations; |
| 28 | +import static org.mockito.Mockito.mock; |
| 29 | +import static org.mockito.Mockito.when; |
| 30 | + |
3 | 31 | import com.igormaznitsa.prologparser.exceptions.PrologParserException; |
4 | 32 | import com.igormaznitsa.prologparser.terms.OpContainer; |
5 | 33 | import com.igormaznitsa.prologparser.terms.PrologAtom; |
|
32 | 60 | import java.util.Set; |
33 | 61 | import java.util.concurrent.atomic.AtomicInteger; |
34 | 62 |
|
35 | | -import static com.igormaznitsa.prologparser.DefaultParserContext.of; |
36 | | -import static com.igormaznitsa.prologparser.ParserContext.*; |
37 | | -import static com.igormaznitsa.prologparser.terms.OpContainer.make; |
38 | | -import static com.igormaznitsa.prologparser.terms.PrologTerm.QuotingType.*; |
39 | | -import static com.igormaznitsa.prologparser.terms.TermType.ATOM; |
40 | | -import static com.igormaznitsa.prologparser.tokenizer.OpAssoc.*; |
41 | | -import static java.util.stream.Collectors.joining; |
42 | | -import static org.junit.jupiter.api.Assertions.*; |
43 | | -import static org.mockito.Mockito.*; |
44 | | - |
45 | 63 | public class IntegrationTest { |
46 | 64 |
|
47 | 65 | private static PrologParser parseCpl(final String str) { |
@@ -977,7 +995,7 @@ public void testOperatorAsFunctor() throws Exception { |
977 | 995 |
|
978 | 996 | @Test |
979 | 997 | public void testPairOfOperatorsWithIncompatiblePrecedence() throws Exception { |
980 | | -// assertEquals("", parseEd("1---1.").next().toString()); |
| 998 | + assertEquals("1 - - -1", parseEd("1---1.").next().toString()); |
981 | 999 | assertEquals("1 + 1 * a * a + a - 1", parseEd("1+1*a*a+a-1.").next().toString()); |
982 | 1000 | assertEquals("-1 + 2 ** (- 3 ** (-4))", parseEd("-1+2**-3**-4.").next().toString()); |
983 | 1001 | assertEquals("X = (discontiguous)", parseEd("X=discontiguous.").next().toString()); |
|
0 commit comments