-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show a solution to the parsing problem: a duplicated Call rule, in ex…
…pr6. I probably won't use it in the article, as it adds complexity.
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
part-12/src/test/java/com/endoflineblog/truffle/part_12/ParsingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.endoflineblog.truffle.part_12; | ||
|
||
import org.graalvm.polyglot.Context; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ParsingTest { | ||
private Context context; | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
this.context = Context.create(); | ||
} | ||
|
||
@AfterEach | ||
public void tearDown() { | ||
this.context.close(); | ||
} | ||
|
||
@Test | ||
public void multiple_calls_of_calls_are_parsed() { | ||
this.context.parse("ezs", "a()()()"); | ||
} | ||
|
||
@Test | ||
public void property_reads_of_property_reads_are_parsed() { | ||
this.context.parse("ezs", "a.b.c"); | ||
} | ||
|
||
@Test | ||
public void method_calls_of_calls_are_parsed() { | ||
this.context.parse("ezs", "a().b().c()"); | ||
} | ||
} |