Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pie dsl string generation + tests #10

Merged
merged 256 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
2dad19d
Merge branch 'develop'
Gohla Nov 21, 2019
a4842db
Create stub for Java AST compiler
MeAmAnUsername Nov 27, 2019
6bc7440
rename gen/java to gen/java-string
MeAmAnUsername Nov 28, 2019
93e9239
Merge branch 'develop' into pie-dsl
MeAmAnUsername Nov 28, 2019
6c7a84d
Copy paste Java syntax into pie.lang
MeAmAnUsername Nov 28, 2019
6b47986
Convert copy and adapt type.str to compile to AST nodes
MeAmAnUsername Nov 28, 2019
f730463
Add ignore for java files generated from examples
MeAmAnUsername Nov 28, 2019
4912bce
copy func_body and convert until block expression
MeAmAnUsername Nov 28, 2019
5b8f65c
convert ToNullable and ToNonNullable
MeAmAnUsername Nov 28, 2019
b1d574c
Convert Not
MeAmAnUsername Nov 28, 2019
20abad5
Convert If
MeAmAnUsername Nov 28, 2019
c80a28f
Convert IfElse
MeAmAnUsername Nov 28, 2019
0dc4430
Copy and convert binder.str
MeAmAnUsername Nov 28, 2019
ac5db6e
Merge branch 'pie-dsl' into pie-dsl-func_body
MeAmAnUsername Nov 28, 2019
16d37aa
Convert ValDec
MeAmAnUsername Nov 28, 2019
52785b5
Add missing import
MeAmAnUsername Nov 29, 2019
62f4898
Fix incorrect types (should be class types, not primitive)
MeAmAnUsername Nov 29, 2019
e498dfe
Convert Ref
MeAmAnUsername Nov 29, 2019
73cba05
Convert Call
MeAmAnUsername Nov 29, 2019
31e18e8
Convert QCall
MeAmAnUsername Nov 29, 2019
acc1d0e
Fix some mistakes in ToNonNullable
MeAmAnUsername Nov 29, 2019
e3214c6
rename some strategy names that I forget the first time
MeAmAnUsername Nov 29, 2019
aaa3c68
convert Call (Pie calls)
MeAmAnUsername Nov 29, 2019
a883cde
AQdd missing import
MeAmAnUsername Nov 29, 2019
0b05eec
Add missing / remove incorrect lists start & end
MeAmAnUsername Nov 29, 2019
51d22b0
Fix incorrect strategy name
MeAmAnUsername Nov 29, 2019
ca9e8bb
Add / fix some documentation comments
MeAmAnUsername Nov 29, 2019
52d3e09
Convert RequiresPath and GeneratesPath
MeAmAnUsername Nov 29, 2019
ee1c9aa
Convert ReadPath
MeAmAnUsername Nov 29, 2019
df0feab
Convert ExistsPath
MeAmAnUsername Nov 29, 2019
944aae2
Convert Fail
MeAmAnUsername Nov 29, 2019
49c539c
Convert simple literals
MeAmAnUsername Nov 29, 2019
b77ebd2
Add missing -ast-
MeAmAnUsername Nov 29, 2019
29eadb1
Convert TupleLit
MeAmAnUsername Nov 29, 2019
640932a
Convert ListLit
MeAmAnUsername Nov 29, 2019
e32c2fa
Convert StrLit
MeAmAnUsername Nov 29, 2019
e9ace97
Merge branch 'develop' into pie-dsl
MeAmAnUsername Dec 2, 2019
50e42b4
Merge branch 'pie-dsl' into pie-dsl-func_body
MeAmAnUsername Dec 2, 2019
debce6e
Replace Strs with Exps
MeAmAnUsername Dec 2, 2019
1f04d6a
Convert PathLit
MeAmAnUsername Dec 2, 2019
ad6ffca
Convert ListPath and WalkPath
MeAmAnUsername Dec 2, 2019
609bdd8
Convert binexps
MeAmAnUsername Dec 2, 2019
5339b0c
Convert Add
MeAmAnUsername Dec 2, 2019
456953b
Fix + clarify documentation
MeAmAnUsername Dec 3, 2019
2304b92
Convert ListComprehension
MeAmAnUsername Dec 3, 2019
6ed1f91
Fix module names
MeAmAnUsername Dec 3, 2019
9c833aa
Fix module name
MeAmAnUsername Dec 3, 2019
1be70c8
Merge branch 'pie-dsl' into pie-dsl-func_body
MeAmAnUsername Dec 3, 2019
21bf545
Convert Return
MeAmAnUsername Dec 3, 2019
8f411f8
Add missing import
MeAmAnUsername Dec 3, 2019
fc7bea3
Fix incorrect copy-paste
MeAmAnUsername Dec 3, 2019
05bca4c
Copy func_def.str and fix module name + imports
MeAmAnUsername Dec 3, 2019
123cdd1
convert p2j-ast-pie-func-impl-returnvalue
MeAmAnUsername Dec 3, 2019
9410c32
Add documentation
MeAmAnUsername Dec 3, 2019
c952648
Remove extra space
MeAmAnUsername Dec 3, 2019
3bd7c01
Add missing Some constructor
MeAmAnUsername Dec 3, 2019
6f971a9
Convert p2j-ast-type-generate-dataclass and type-tuple-to-X
MeAmAnUsername Dec 3, 2019
6edfdb2
Merge branch 'pie-dsl' into pie-dsl-func_def
MeAmAnUsername Dec 3, 2019
a729c32
Convert p2j-ast-pie-func-impl-inputsig
MeAmAnUsername Dec 3, 2019
198c579
Convert p2j-ast-pie-func-impl-outputsig
MeAmAnUsername Dec 3, 2019
24da4d0
Convert p2j-ast-pie-func-key-body
MeAmAnUsername Dec 3, 2019
33b2b67
Merge two cases of p2j-ast-pie-func-impl-outputsig
MeAmAnUsername Dec 3, 2019
9f57c02
Add EmptyBlock and convert p2j-ast-...-impl-body
MeAmAnUsername Dec 4, 2019
7eadf5f
Convert p2j-ast-def
MeAmAnUsername Dec 4, 2019
44b565d
Convert main.str
MeAmAnUsername Dec 6, 2019
c40fd78
Add missing -ast- to strategy name
MeAmAnUsername Dec 6, 2019
7db84bf
Bugfix (replace int-to-string with string-to-int)
MeAmAnUsername Dec 6, 2019
b7f684e
Bugfix: name clash (condExpVal was already used)
MeAmAnUsername Dec 6, 2019
8f8103e
Add debug statements for logging the current function
MeAmAnUsername Dec 6, 2019
7d7145b
Bugfix: put dataclass in list
MeAmAnUsername Dec 6, 2019
286f79d
Fix indentation
MeAmAnUsername Dec 6, 2019
e0f6710
Bugfix: name clash (exp was already used)
MeAmAnUsername Dec 6, 2019
bb34f19
Bugfix: use Pie Type for bind-tuples-to-ast-assignments
MeAmAnUsername Dec 6, 2019
7fca908
remove lang/syntax/java, add java signatures + java pp
MeAmAnUsername Dec 10, 2019
423db49
Fix some bugs in main.str
MeAmAnUsername Dec 10, 2019
cabd503
Fix bugs in p2j-ast-type-sig
MeAmAnUsername Dec 10, 2019
dfca3ec
Fix p2j-ast-type-generate-dataclass + helper methods
MeAmAnUsername Dec 10, 2019
a86f182
fix Block
MeAmAnUsername Dec 10, 2019
571d25c
fix ToNonNullable
MeAmAnUsername Dec 10, 2019
3f297d4
fix Eq and Neq
MeAmAnUsername Dec 10, 2019
ccef67b
Fix IfElse
MeAmAnUsername Dec 10, 2019
7af8f39
Fix Add
MeAmAnUsername Dec 10, 2019
2dd649d
Fix ListComprehension
MeAmAnUsername Dec 10, 2019
36cd4c9
Fix ValDec
MeAmAnUsername Dec 10, 2019
71ead90
Fix Ref
MeAmAnUsername Dec 10, 2019
ee7b43c
Fix Call
MeAmAnUsername Dec 10, 2019
65b9669
Fix QCall
MeAmAnUsername Dec 10, 2019
976a49b
Fix Call (pie specific)
MeAmAnUsername Dec 10, 2019
eb7023a
Fix RequiresPath and GeneratesPath
MeAmAnUsername Dec 10, 2019
ec63a1b
Fix ListPath and WalkPath
MeAmAnUsername Dec 10, 2019
cd6e1b8
Fix ReadPath and ExistsPath
MeAmAnUsername Dec 10, 2019
7d98978
Fix Fail
MeAmAnUsername Dec 10, 2019
d91160d
Fix simple literals
MeAmAnUsername Dec 10, 2019
df65326
Fix TupleLit and ListLit
MeAmAnUsername Dec 10, 2019
f96a440
Fix PathLit
MeAmAnUsername Dec 10, 2019
10e5f08
Fix p2j-ast-pie-func-key-body
MeAmAnUsername Dec 10, 2019
a0c0e4e
Fix p2j-ast-pie-func-impl-outputsig
MeAmAnUsername Dec 10, 2019
dcba688
Fix p2j-ast-pie-func-impl-inputsig
MeAmAnUsername Dec 10, 2019
b6c7b39
Fix p2j-ast-pie-func-impl-returnvalue
MeAmAnUsername Dec 10, 2019
b3ea604
Actually use is-tuple-type
MeAmAnUsername Dec 10, 2019
06ba192
Fix p2j-ast-def
MeAmAnUsername Dec 10, 2019
35d57ed
fix bug in p2j-ast-exp-pie-call
MeAmAnUsername Dec 10, 2019
66e4f1a
Fix missing VariableDecl
MeAmAnUsername Dec 10, 2019
38bc878
Fix bug: Formal parameters shouldn't have annotations
MeAmAnUsername Dec 11, 2019
8a5acd4
Bug fix: Use required QualifiedId instead of Id
MeAmAnUsername Dec 11, 2019
b5c8221
Bug fix: don't convert string to int, keep it string
MeAmAnUsername Dec 11, 2019
ce3da44
Bug fix: replace StrLit with StringLiteral
MeAmAnUsername Dec 11, 2019
17c2f8b
Bug fix: add missing Some(SuperInterface(...))
MeAmAnUsername Dec 11, 2019
c899ea7
Bug fix: remove conversion to Unnan ClassType
MeAmAnUsername Dec 11, 2019
3f0c847
Make constructor public
MeAmAnUsername Dec 11, 2019
0b1b9c6
Bug fix: add missing VariableDecl in FormalParam
MeAmAnUsername Dec 11, 2019
d53bafd
Bug fix: add missing list in Block
MeAmAnUsername Dec 11, 2019
e6d15d0
Bug fix: convert formal params to Unann ClassTypes
MeAmAnUsername Dec 11, 2019
02113ab
Bug fix: put ExpressionStatement around constructor assignments
MeAmAnUsername Dec 11, 2019
4209dc9
Bug fix: undo removing list of VariableModifiers
MeAmAnUsername Dec 11, 2019
3e1499d
Fix annotated / unannotated input signatures
MeAmAnUsername Dec 11, 2019
838cb74
Bug fix: Add list + VariableDecl for _id field
MeAmAnUsername Dec 11, 2019
72211cd
Bug fix: add missing VariableDecl
MeAmAnUsername Dec 11, 2019
38ab236
Bug fix: add missing list to adhere to documented interface
MeAmAnUsername Dec 11, 2019
99ff7c2
Bug fix: outputType for Exec should be unannotated
MeAmAnUsername Dec 11, 2019
80699db
Bug fix: Local var type should be unannotated
MeAmAnUsername Dec 11, 2019
73f2660
Take only the value when return type is unit
MeAmAnUsername Dec 11, 2019
eec536d
Bug fix: add required annotations list
MeAmAnUsername Dec 11, 2019
d0095f1
Bug fix: add missing SuperInterface in dataclass
MeAmAnUsername Dec 11, 2019
eb1fc5e
Fix bugs in data class generation
MeAmAnUsername Dec 12, 2019
bb4d617
Bug fix: interface for data classes
MeAmAnUsername Dec 12, 2019
e3d5b30
Fix bug: put newinstance expression into list, reformat
MeAmAnUsername Dec 12, 2019
69d3b96
Fix bug: define and use fold-left instead of reduce
MeAmAnUsername Dec 12, 2019
a6572e9
Bug fix: add methodName for method name
MeAmAnUsername Dec 12, 2019
7992578
Fix bug: try-p2j-ast-exp should also return a list of statements
MeAmAnUsername Dec 12, 2019
a9cd038
Remove debug statement for Blocks
MeAmAnUsername Dec 12, 2019
4827142
Fix bug: use Java expressions instead of Pie expressions
MeAmAnUsername Dec 12, 2019
70463d7
Fix incorrect ListTy Pie -> Java transformation
MeAmAnUsername Dec 12, 2019
088c049
Add missing imports
MeAmAnUsername Dec 13, 2019
bc48e93
Allow layout between curly braces in EmptyBlock
MeAmAnUsername Dec 13, 2019
0bdd79a
Merge remote-tracking branch 'origin/develop' into pie-dsl
MeAmAnUsername Dec 13, 2019
87a6973
Call AST pie compilation
MeAmAnUsername Dec 13, 2019
1b6ba4f
enable pie test file
MeAmAnUsername Dec 16, 2019
5ee09b4
access static _id field via class
MeAmAnUsername Dec 16, 2019
6293a87
update default package
MeAmAnUsername Dec 16, 2019
e5289c1
Fill in the test
MeAmAnUsername Dec 16, 2019
4fd30b0
Add generated test file to .gitignore
MeAmAnUsername Dec 16, 2019
9edf851
Add missing imports
MeAmAnUsername Dec 17, 2019
0abd946
Start import generation
MeAmAnUsername Dec 17, 2019
055ab15
move p2j-ast-wrap-string-with-id to ast-util
MeAmAnUsername Dec 17, 2019
94ebe16
Update documentation
MeAmAnUsername Dec 17, 2019
0aa6d4f
Move java-classType-to-unnanType to ast-util
MeAmAnUsername Dec 17, 2019
7520c93
Add import generation to p2j-ast-type-generate-dataclass
MeAmAnUsername Dec 17, 2019
6b0369b
Add documentation
MeAmAnUsername Dec 17, 2019
3cac652
Add more import generation
MeAmAnUsername Dec 17, 2019
7cf172f
Add Nullable annotation to fromTuple
MeAmAnUsername Dec 17, 2019
cb8f1ce
Add more import generation
MeAmAnUsername Dec 17, 2019
2f3e726
Add missing import in ast-util.str
MeAmAnUsername Jan 7, 2020
fb39fba
Combine two maps into one
MeAmAnUsername Jan 7, 2020
3de4aac
Add java imports
MeAmAnUsername Jan 7, 2020
8780f98
Fix bug: statements are used; just make it usable
MeAmAnUsername Jan 7, 2020
1ee43df
First argument is the expected value
MeAmAnUsername Jan 8, 2020
374f4b9
Create tests for types / literals (directly return literal)
MeAmAnUsername Jan 8, 2020
e7c3d40
Change function names to be unique
MeAmAnUsername Jan 8, 2020
de6b1a1
Update test files with new class names + other fixes
MeAmAnUsername Jan 8, 2020
0402a60
Make Foo Serializable (required for Task input/output)
MeAmAnUsername Jan 8, 2020
4e7d31b
Create test for ListOfTupleWithNullable
MeAmAnUsername Jan 8, 2020
7a10d47
Fix bug: p2j-ast-pie-func-impl-returnvalue expects Pie type
MeAmAnUsername Jan 8, 2020
b714fbd
Add missing Java import
MeAmAnUsername Jan 8, 2020
b54feaa
move all current test files to new subpackage
MeAmAnUsername Jan 9, 2020
c409dcb
Add Tuple1.java
MeAmAnUsername Jan 9, 2020
5321792
Edit generated package
MeAmAnUsername Jan 9, 2020
1953160
Create tests for variables
MeAmAnUsername Jan 9, 2020
254eecd
Change package to todo
MeAmAnUsername Jan 9, 2020
9058d5b
Comment out test failing test cases
MeAmAnUsername Jan 13, 2020
7923a75
Use declaration type to get variable type
MeAmAnUsername Jan 13, 2020
720b9ea
Write tests for unary operators
MeAmAnUsername Jan 13, 2020
ec23948
Add missing imports
MeAmAnUsername Jan 13, 2020
613b839
Catch NullPointerException and rethrow as ExecException in toNonNullable
MeAmAnUsername Jan 14, 2020
35c6ef3
Catch InterruptedException and rethrow as ExecException in require
MeAmAnUsername Jan 14, 2020
e43137a
Use Provider<T> for injected tasks to allow recursive functions
MeAmAnUsername Jan 14, 2020
7453337
Add some tests for multiple function definitions
MeAmAnUsername Jan 14, 2020
86a1cf7
Add package statement to Pie DSL
MeAmAnUsername Jan 15, 2020
fc3c803
Tmp commit to move to Mac (PC power is dying)
MeAmAnUsername Jan 15, 2020
4279dd9
WIP providers
Gohla Jan 15, 2020
d9ec250
Add package statement to spt test
MeAmAnUsername Jan 15, 2020
ee82caa
Fix mocking.
Gohla Jan 16, 2020
d2851ba
Use correct way to create tasks; moved to own class (SimpleChecker)
MeAmAnUsername Jan 16, 2020
7747739
Add import, rename typo, fix type errors
MeAmAnUsername Jan 16, 2020
c5dc0bc
"Fix" Java warning
MeAmAnUsername Jan 16, 2020
05e5ab1
Disable lang.javainstratego project.
Gohla Jan 17, 2020
bf7ef28
Add missing import generation
MeAmAnUsername Jan 17, 2020
d78d2dd
update template.java.ignored
MeAmAnUsername Jan 17, 2020
6da19fa
Add tests for equals operator
MeAmAnUsername Jan 17, 2020
fd48994
remove trailing whitespace
MeAmAnUsername Jan 20, 2020
8b58132
Add suffix TestGen to pie file names
MeAmAnUsername Jan 20, 2020
a6953de
Merge remote-tracking branch 'origin/develop' into pie-dsl
MeAmAnUsername Jan 20, 2020
8ac00d0
Remove files that were not renamed for some reason
MeAmAnUsername Jan 20, 2020
5077bbb
Add missing TestGen suffix in Java Test files
MeAmAnUsername Jan 20, 2020
9dfb3fb
Add tests for neq (not equal)
MeAmAnUsername Jan 20, 2020
4ada24a
Write tests for logical or and logical and
MeAmAnUsername Jan 20, 2020
ec12d71
Write tests for add
MeAmAnUsername Jan 22, 2020
8525af3
Write tests for add, change p2j-ast-add, add toString for Tuple
MeAmAnUsername Jan 23, 2020
353e263
replace appendSegment with appendOrReplaceWithPath
MeAmAnUsername Jan 23, 2020
ba24780
Merge branch 'develop'
Gohla Feb 5, 2020
3899efc
Merge branch 'develop'
Gohla Mar 5, 2020
d66e602
Merge branch 'develop'
Gohla Mar 25, 2020
8a911a6
Merge branch 'develop'
Gohla Apr 2, 2020
5c2a297
Merge branch 'develop'
Gohla Apr 9, 2020
dfdfd00
Merge branch 'develop'
Gohla Apr 21, 2020
b6befdd
Merge branch 'develop'
Gohla May 6, 2020
8998149
Merge branch 'master' into pie-dsl
MeAmAnUsername May 6, 2020
d2cee70
Add some string tests
MeAmAnUsername Apr 30, 2020
64523f1
Add code to handle empty string
MeAmAnUsername Apr 30, 2020
9ca51e9
Add String.valueOf() around interpolated string expressions
MeAmAnUsername May 4, 2020
e557363
Add tests for strings
MeAmAnUsername May 4, 2020
fdb0112
This makes it fail to parse entirely, running gradle the build succee…
MeAmAnUsername May 4, 2020
443bb77
simplify grammar
MeAmAnUsername May 6, 2020
7b1204f
Fix grammar error by removing allowed characters
MeAmAnUsername May 7, 2020
05ac0ff
Fix rename from PieSession to Session
MeAmAnUsername May 7, 2020
9b2e791
Add java tests for strings
MeAmAnUsername May 7, 2020
b69d2c1
Add tests variable interpolation with integers + compiler fix
MeAmAnUsername May 7, 2020
e36a9cd
Add tests for variable interpolation with multiple use
MeAmAnUsername May 7, 2020
2e73056
rename PieSession -> Session
MeAmAnUsername May 11, 2020
bb88010
Fix Stratego signature imports
MeAmAnUsername May 11, 2020
506fcba
Fix errors in Block compilation
MeAmAnUsername May 11, 2020
149436a
Fix IfElse errors in compiler
MeAmAnUsername May 11, 2020
0ce60e9
Fix QCall compiler error (pretty-printing)
MeAmAnUsername May 11, 2020
b133427
Add java constructors
MeAmAnUsername Feb 22, 2020
91bd7b3
Switch to dagger injection
MeAmAnUsername May 12, 2020
da195fd
Fix NPE on equals + add tests
MeAmAnUsername May 15, 2020
b61b3ff
Update transient values compilation
MeAmAnUsername May 19, 2020
e30db86
Generate a file for each task
MeAmAnUsername May 15, 2020
fd65926
Implement suppliers
MeAmAnUsername May 20, 2020
48856e1
Throw Exception instead of ExecException
MeAmAnUsername May 22, 2020
f752a66
Implement modules
MeAmAnUsername May 26, 2020
f94077e
Merge branch 'pie-dsl' into pie-dsl-modules-merge-back
MeAmAnUsername May 26, 2020
72244d3
Change supplier generation: use ValueSupplier instead of lambda
MeAmAnUsername Jun 1, 2020
ba3fd42
Change getting supplier value: use context.require(supplier) instead …
MeAmAnUsername Jun 1, 2020
cee95cc
Remove package statement
MeAmAnUsername Jun 3, 2020
95dff5d
Remove semicolons after module and import statements
MeAmAnUsername Jun 6, 2020
8cfa70d
Change syntax for modules and imports: use colon instead of period
MeAmAnUsername Jun 6, 2020
c40d61b
Merge remote-tracking branch 'upstream/develop' into pie-dsl-merge-fr…
MeAmAnUsername Jun 7, 2020
fe4157b
remove outdated git ignore file
MeAmAnUsername Jun 9, 2020
54658ed
remove java pretty printing and signatures
MeAmAnUsername Jun 9, 2020
c3af85b
Move dagger version to :pie.depconstraints
MeAmAnUsername Jun 8, 2020
462cc4a
Merge remote-tracking branch 'upstream/develop' into pie-dsl
MeAmAnUsername Jun 17, 2020
cac821f
Merge branch 'develop' into pie-dsl
MeAmAnUsername Jul 14, 2020
d56ca6f
Merge branch 'pie-dsl' into pie-dsl-string
MeAmAnUsername Jul 26, 2020
a88d7c7
Update tests from merge
MeAmAnUsername Jul 30, 2020
7961772
Merge branch 'develop' into pie-dsl
MeAmAnUsername Aug 2, 2020
f35c399
Merge branch 'pie-dsl' into pie-dsl-string
MeAmAnUsername Aug 2, 2020
8ee605b
Add string spt tests
MeAmAnUsername Sep 3, 2020
2015531
Resolve negative number/ID ambiguity
MeAmAnUsername Sep 3, 2020
507fc40
Merge remote-tracking branch 'upstream/develop' into pie-dsl-string
MeAmAnUsername Sep 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mb.pie.lang.test.string.empty;

import mb.pie.api.ExecException;
import org.junit.jupiter.api.Test;

import static mb.pie.lang.test.util.SimpleChecker.assertTaskOutputEquals;

class EmptyTest {
@Test void test() throws ExecException {
assertTaskOutputEquals(DaggeremptyComponent.class, "");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mb.pie.lang.test.string.empty;

import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ElementsIntoSet;
import mb.pie.api.TaskDef;

import javax.inject.Singleton;
import java.util.HashSet;
import java.util.Set;

@Module
abstract class PieTestModule {
@Provides @Singleton @ElementsIntoSet
public static Set<TaskDef<?, ?>> provideTaskDefs(
main_empty empty
) {
final HashSet<TaskDef<?, ?>> taskDefs = new HashSet<>(1, 1);
taskDefs.add(empty);
return taskDefs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module mb:pie:lang:test:string:empty

func main_empty() -> string = {
""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package mb.pie.lang.test.string.empty;

import dagger.Component;
import mb.pie.dagger.PieComponent;
import mb.pie.dagger.PieModule;

import javax.inject.Singleton;

@Singleton
@Component(modules = {PieModule.class, PieTestModule.class})
public interface emptyComponent extends PieComponent {
main_empty get();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mb.pie.lang.test.string.escapeDouble;

import mb.pie.api.ExecException;
import org.junit.jupiter.api.Test;

import static mb.pie.lang.test.util.SimpleChecker.assertTaskOutputEquals;

class EscapeDoubleTest {
@Test void test() throws ExecException {
assertTaskOutputEquals(DaggerescapeDoubleComponent.class, "$$");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mb.pie.lang.test.string.escapeDouble;

import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ElementsIntoSet;
import mb.pie.api.TaskDef;

import javax.inject.Singleton;
import java.util.HashSet;
import java.util.Set;

@Module
abstract class PieTestModule {
@Provides @Singleton @ElementsIntoSet
public static Set<TaskDef<?, ?>> provideTaskDefs(
main_escapeDouble escapeDouble
) {
final HashSet<TaskDef<?, ?>> taskDefs = new HashSet<>(1, 1);
taskDefs.add(escapeDouble);
return taskDefs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module mb:pie:lang:test:string:escapeDouble

func main_escapeDouble() -> string = {
"\$\$"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package mb.pie.lang.test.string.escapeDouble;

import dagger.Component;
import mb.pie.dagger.PieComponent;
import mb.pie.dagger.PieModule;

import javax.inject.Singleton;

@Singleton
@Component(modules = {PieModule.class, PieTestModule.class})
public interface escapeDoubleComponent extends PieComponent {
main_escapeDouble get();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mb.pie.lang.test.string.escapeSingle;

import mb.pie.api.ExecException;
import org.junit.jupiter.api.Test;

import static mb.pie.lang.test.util.SimpleChecker.assertTaskOutputEquals;

class EscapeSingleTest {
@Test void test() throws ExecException {
assertTaskOutputEquals(DaggerescapeSingleComponent.class, "$");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mb.pie.lang.test.string.escapeSingle;

import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ElementsIntoSet;
import mb.pie.api.TaskDef;

import javax.inject.Singleton;
import java.util.HashSet;
import java.util.Set;

@Module
abstract class PieTestModule {
@Provides @Singleton @ElementsIntoSet
public static Set<TaskDef<?, ?>> provideTaskDefs(
main_escapeSingle escapeSingle
) {
final HashSet<TaskDef<?, ?>> taskDefs = new HashSet<>(1, 1);
taskDefs.add(escapeSingle);
return taskDefs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module mb:pie:lang:test:string:escapeSingle

func main_escapeSingle() -> string = {
"\$"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package mb.pie.lang.test.string.escapeSingle;

import dagger.Component;
import mb.pie.dagger.PieComponent;
import mb.pie.dagger.PieModule;

import javax.inject.Singleton;

@Singleton
@Component(modules = {PieModule.class, PieTestModule.class})
public interface escapeSingleComponent extends PieComponent {
main_escapeSingle get();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mb.pie.lang.test.string.expressionInterpolation;

import mb.pie.api.ExecException;
import org.junit.jupiter.api.Test;

import static mb.pie.lang.test.util.SimpleChecker.assertTaskOutputEquals;

class ExpressionInterpolationTest {
@Test void test() throws ExecException {
assertTaskOutputEquals(DaggerexpressionInterpolationComponent.class, "1 + 2 = 3.");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mb.pie.lang.test.string.expressionInterpolation;

import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ElementsIntoSet;
import mb.pie.api.TaskDef;

import javax.inject.Singleton;
import java.util.HashSet;
import java.util.Set;

@Module
abstract class PieTestModule {
@Provides @Singleton @ElementsIntoSet
public static Set<TaskDef<?, ?>> provideTaskDefs(
main_expressionInterpolation expressionInterpolation
) {
final HashSet<TaskDef<?, ?>> taskDefs = new HashSet<>(1, 1);
taskDefs.add(expressionInterpolation);
return taskDefs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module mb:pie:lang:test:string:expressionInterpolation

func main_expressionInterpolation() -> string = {
"1 + 2 = ${1 + 2}."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package mb.pie.lang.test.string.expressionInterpolation;

import dagger.Component;
import mb.pie.dagger.PieComponent;
import mb.pie.dagger.PieModule;

import javax.inject.Singleton;

@Singleton
@Component(modules = {PieModule.class, PieTestModule.class})
public interface expressionInterpolationComponent extends PieComponent {
main_expressionInterpolation get();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package mb.pie.lang.test.string.expressionInterpolationList;

import mb.pie.api.*;
import mb.pie.dagger.PieModule;
import mb.pie.runtime.PieBuilderImpl;
import mb.pie.util.Tuple2;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;

import static org.junit.jupiter.api.Assertions.assertEquals;

class ExpressionInterpolationListTest {
@Test void test() throws ExecException, InterruptedException {
final expressionInterpolationListComponent component = DaggerexpressionInterpolationListComponent.builder()
.pieModule(new PieModule(PieBuilderImpl::new))
.build();
final Pie pie = component.getPie();
try(MixedSession session = pie.newSession()) {
main_expressionInterpolationList main = component.get();
final Tuple2<ArrayList<Integer>, String> output = session.require(main.createTask(None.instance));
final String expected = "list: " + output.component1();
final String actual = output.component2();
assertEquals(expected, actual);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mb.pie.lang.test.string.expressionInterpolationList;

import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ElementsIntoSet;
import mb.pie.api.TaskDef;

import javax.inject.Singleton;
import java.util.HashSet;
import java.util.Set;

@Module
abstract class PieTestModule {
@Provides @Singleton @ElementsIntoSet
public static Set<TaskDef<?, ?>> provideTaskDefs(
main_expressionInterpolationList expressionInterpolationList
) {
final HashSet<TaskDef<?, ?>> taskDefs = new HashSet<>(1, 1);
taskDefs.add(expressionInterpolationList);
return taskDefs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module mb:pie:lang:test:string:expressionInterpolationList

func main_expressionInterpolationList() -> (int*, string) = {
val list = [1, 2, 3];
(list, "list: ${list}")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package mb.pie.lang.test.string.expressionInterpolationList;

import dagger.Component;
import mb.pie.dagger.PieComponent;
import mb.pie.dagger.PieModule;

import javax.inject.Singleton;

@Singleton
@Component(modules = {PieModule.class, PieTestModule.class})
public interface expressionInterpolationListComponent extends PieComponent {
main_expressionInterpolationList get();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mb.pie.lang.test.string.expressionInterpolationLiteralBetween;

import mb.pie.api.ExecException;
import org.junit.jupiter.api.Test;

import static mb.pie.lang.test.util.SimpleChecker.assertTaskOutputEquals;

class ExpressionInterpolationLiteralBetweenTest {
@Test void test() throws ExecException {
assertTaskOutputEquals(DaggerexpressionInterpolationLiteralBetweenComponent.class, "2 + 2 = 4 = 4 = 3 + 1");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mb.pie.lang.test.string.expressionInterpolationLiteralBetween;

import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ElementsIntoSet;
import mb.pie.api.TaskDef;

import javax.inject.Singleton;
import java.util.HashSet;
import java.util.Set;

@Module
abstract class PieTestModule {
@Provides @Singleton @ElementsIntoSet
public static Set<TaskDef<?, ?>> provideTaskDefs(
main_expressionInterpolationLiteralBetween expressionInterpolationLiteralBetween
) {
final HashSet<TaskDef<?, ?>> taskDefs = new HashSet<>(1, 1);
taskDefs.add(expressionInterpolationLiteralBetween);
return taskDefs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module mb:pie:lang:test:string:expressionInterpolationLiteralBetween

func main_expressionInterpolationLiteralBetween() -> string = {
"2 + 2 = ${2 + 2} = ${3 + 1} = 3 + 1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package mb.pie.lang.test.string.expressionInterpolationLiteralBetween;

import dagger.Component;
import mb.pie.dagger.PieComponent;
import mb.pie.dagger.PieModule;

import javax.inject.Singleton;

@Singleton
@Component(modules = {PieModule.class, PieTestModule.class})
public interface expressionInterpolationLiteralBetweenComponent extends PieComponent {
main_expressionInterpolationLiteralBetween get();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mb.pie.lang.test.string.expressionInterpolationNothingBetween;

import mb.pie.api.ExecException;
import org.junit.jupiter.api.Test;

import static mb.pie.lang.test.util.SimpleChecker.assertTaskOutputEquals;

class ExpressionInterpolationNothingBetweenTest {
@Test void test() throws ExecException {
assertTaskOutputEquals(DaggerexpressionInterpolationNothingBetweenComponent.class, "42");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mb.pie.lang.test.string.expressionInterpolationNothingBetween;

import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ElementsIntoSet;
import mb.pie.api.TaskDef;

import javax.inject.Singleton;
import java.util.HashSet;
import java.util.Set;

@Module
abstract class PieTestModule {
@Provides @Singleton @ElementsIntoSet
public static Set<TaskDef<?, ?>> provideTaskDefs(
main_expressionInterpolationNothingBetween expressionInterpolationNothingBetween
) {
final HashSet<TaskDef<?, ?>> taskDefs = new HashSet<>(1, 1);
taskDefs.add(expressionInterpolationNothingBetween);
return taskDefs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module mb:pie:lang:test:string:expressionInterpolationNothingBetween

func main_expressionInterpolationNothingBetween() -> string = {
"${-1 + 5}${1 + 1}"
}
Loading