Skip to content

Commit 36d3c10

Browse files
committed
Java token positions tests for tokens:
J_BREAK J_CASE J_CATCH_BEGIN J_CATCH_END J_CLASS_BEGIN J_CLASS_END J_COND
1 parent 5e201c7 commit 36d3c10

File tree

10 files changed

+79
-0
lines changed

10 files changed

+79
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
>public class Break {
2+
> void test() {
3+
> do {
4+
> break;
5+
$ | J_BREAK 5
6+
> } while(true);
7+
> }
8+
>}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>public class Break {
2+
> void test() {
3+
> int x = 1;
4+
> switch(x) {
5+
> case 1:
6+
> break;
7+
$ | J_BREAK 5
8+
> }
9+
> }
10+
>}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>public class Case {
2+
> void test() {
3+
> int x = 1;
4+
> switch(x) {
5+
> case 1:
6+
$ | J_CASE 4
7+
> break;
8+
> }
9+
> }
10+
>}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
>public class Catch {
2+
> void x() {
3+
> try {
4+
> } catch (Exception e) {
5+
$ | J_CATCH_BEGIN 5
6+
> }
7+
$ | J_CATCH_END 1
8+
> }
9+
>}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
>public class Catch {
2+
> void x() {
3+
> try {
4+
> } catch (Exception e) {
5+
$ | J_CATCH_BEGIN 5
6+
> } catch (Throwable t) {
7+
$ | J_CATCH_END 1
8+
$ | J_CATCH_BEGIN 5
9+
> }
10+
$ | J_CATCH_END 1
11+
> }
12+
>}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
>class Class {
2+
$| J_CLASS_BEGIN 5
3+
>}
4+
$| J_CLASS_END 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
>public class Class {
2+
$ | J_CLASS_BEGIN 5
3+
>}
4+
$| J_CLASS_END 1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
>class Cond {
2+
> void test() {
3+
> int x = true ? 1 : 0;
4+
$ | J_COND 1
5+
> }
6+
>}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>class Cond {
2+
> void test() {
3+
> int x = condition() ? 1 + 2 : Math.abs(-1);
4+
$ | J_COND 1
5+
> }
6+
>
7+
> boolean condition() {
8+
> return true;
9+
> }
10+
>}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
>class Class {
2+
> public static class InnerClass {
3+
$ | J_CLASS_BEGIN 5
4+
> }
5+
$ | J_CLASS_END 1
6+
>}

0 commit comments

Comments
 (0)