-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-528 Move return type of method to the end of its declaration (Resolve
#528)
- Loading branch information
Showing
20 changed files
with
287 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,6 @@ scripts: { | |
} | ||
|
||
dependencies: [ | ||
github:dzikoysk/[email protected].2 | ||
github:dzikoysk/[email protected].3 | ||
] | ||
|
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
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
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
32 changes: 32 additions & 0 deletions
32
...nda_lang/framework/language/interpreter/pattern/custom/verifiers/NextSectionVerifier.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,32 @@ | ||
/* | ||
* Copyright (c) 2020 Dzikoysk | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.panda_lang.framework.language.interpreter.pattern.custom.verifiers; | ||
|
||
import org.panda_lang.framework.language.resource.syntax.auxiliary.Section; | ||
import org.panda_lang.framework.language.resource.syntax.separator.Separator; | ||
import org.panda_lang.utilities.commons.ObjectUtils; | ||
|
||
public final class NextSectionVerifier extends NextVerifier { | ||
|
||
public NextSectionVerifier(Separator separator) { | ||
super((res, src, s, next) -> { | ||
Section section = ObjectUtils.cast(Section.class, next.getToken()); | ||
return section != null && section.getSeparator().equals(separator); | ||
}); | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
.../org/panda_lang/framework/language/interpreter/pattern/custom/verifiers/NextVerifier.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,44 @@ | ||
/* | ||
* Copyright (c) 2020 Dzikoysk | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.panda_lang.framework.language.interpreter.pattern.custom.verifiers; | ||
|
||
import org.panda_lang.framework.design.interpreter.token.Snippetable; | ||
import org.panda_lang.framework.design.interpreter.token.TokenInfo; | ||
import org.panda_lang.framework.language.interpreter.pattern.custom.CustomVerify; | ||
import org.panda_lang.framework.language.interpreter.token.SynchronizedSource; | ||
import org.panda_lang.utilities.commons.function.QuadPredicate; | ||
|
||
import java.util.Map; | ||
|
||
public class NextVerifier implements CustomVerify<Snippetable> { | ||
|
||
private final QuadPredicate<Map<String, Object>, SynchronizedSource, Snippetable, TokenInfo> predicate; | ||
|
||
public NextVerifier(QuadPredicate<Map<String, Object>, SynchronizedSource, Snippetable, TokenInfo> predicate) { | ||
this.predicate = predicate; | ||
} | ||
|
||
@Override | ||
public boolean verify(Map<String, Object> results, SynchronizedSource source, Snippetable content) { | ||
if (!source.hasNext()) { | ||
return false; | ||
} | ||
|
||
return predicate.test(results, source, content, source.getNext()); | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
...g/panda_lang/framework/language/interpreter/pattern/custom/verifiers/SectionVerifier.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,42 @@ | ||
/* | ||
* Copyright (c) 2020 Dzikoysk | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.panda_lang.framework.language.interpreter.pattern.custom.verifiers; | ||
|
||
import org.panda_lang.framework.design.interpreter.token.TokenInfo; | ||
import org.panda_lang.framework.language.interpreter.pattern.custom.CustomVerify; | ||
import org.panda_lang.framework.language.interpreter.token.SynchronizedSource; | ||
import org.panda_lang.framework.language.resource.syntax.auxiliary.Section; | ||
import org.panda_lang.framework.language.resource.syntax.separator.Separator; | ||
import org.panda_lang.utilities.commons.ObjectUtils; | ||
|
||
import java.util.Map; | ||
|
||
public final class SectionVerifier implements CustomVerify<TokenInfo> { | ||
|
||
private final Separator separator; | ||
|
||
public SectionVerifier(Separator separator) { | ||
this.separator = separator; | ||
} | ||
|
||
@Override | ||
public boolean verify(Map<String, Object> results, SynchronizedSource source, TokenInfo token) { | ||
Section section = ObjectUtils.cast(Section.class, token.getToken()); | ||
return section != null && section.getSeparator().equals(separator); | ||
} | ||
|
||
} |
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
Oops, something went wrong.