-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing cases for overloadedAType for alub and aglb.
- Loading branch information
Showing
4 changed files
with
189 additions
and
9 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
28 changes: 23 additions & 5 deletions
28
src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst3.rsc
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 |
---|---|---|
@@ -1,8 +1,26 @@ | ||
module lang::rascalcore::compile::Examples::Tst3 | ||
|
||
data Maybe[&A] | ||
= nothing() | ||
| just(&A val) | ||
; | ||
syntax Program = ; | ||
|
||
void loadClass( Maybe[loc] file=nothing()) {} | ||
data Tree; | ||
|
||
@javaClass{org.rascalmpl.library.Prelude} | ||
java &T (value input, loc origin) parser(type[&T] grammar); | ||
|
||
alias Parser = Tree (str /*input*/, loc /*origin*/); | ||
alias Outliner = list[DocumentSymbol] (Tree /*input*/); | ||
data DocumentSymbol; | ||
|
||
data LanguageService | ||
= parser(Parser parser) | ||
| outliner(Outliner outliner) | ||
; | ||
|
||
set[LanguageService] SL = { | ||
outliner(picoOutliner), | ||
parser(parser(#start[Program])) | ||
|
||
}; | ||
|
||
list[DocumentSymbol] picoOutliner(start[Program] _input) = []; | ||
|
153 changes: 150 additions & 3 deletions
153
src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst4.rsc
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 |
---|---|---|
@@ -1,5 +1,152 @@ | ||
module lang::rascalcore::compile::Examples::Tst4 | ||
|
||
value main() { | ||
return { /abc/ } := { "abc" }; | ||
} | ||
import lang::rascalcore::check::AType; | ||
import lang::rascalcore::check::BasicRascalConfig; | ||
|
||
value a1() = alub( | ||
overloadedAType({ | ||
<|project://rascal-core/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst3.rsc|(399,6,<18,6>,<18,12>),constructorId(),acons( | ||
aadt( | ||
"LanguageService", | ||
[], | ||
dataSyntax()), | ||
[afunc( | ||
aadt( | ||
"Tree", | ||
[], | ||
dataSyntax()), | ||
[ | ||
astr(), | ||
aloc() | ||
], | ||
[], | ||
alabel="parser")], | ||
[], | ||
alabel="parser")>, | ||
<|project://rascal-core/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst3.rsc|(121,101,<11,0>,<12,59>),functionId(),afunc( | ||
afunc( | ||
aparameter( | ||
"T", | ||
avalue(), | ||
closed=true), | ||
[ | ||
avalue(), | ||
aloc() | ||
], | ||
[]), | ||
[areified( | ||
aparameter( | ||
"T", | ||
avalue(), | ||
closed=false), | ||
alabel="grammar")], | ||
[], | ||
returnsViaAllPath=true, | ||
abstractFingerprint=0, | ||
alabel="parser")> | ||
}), | ||
|
||
acons( | ||
aadt( | ||
"LanguageService", | ||
[], | ||
dataSyntax()), | ||
[afunc( | ||
alist(aadt( | ||
"DocumentSymbol", | ||
[], | ||
dataSyntax())), | ||
[aadt( | ||
"Tree", | ||
[], | ||
dataSyntax())], | ||
[], | ||
alabel="outliner")], | ||
[], | ||
alabel="outliner") | ||
); | ||
|
||
|
||
value a2() = alub( | ||
|
||
afunc( | ||
afunc( | ||
aparameter( | ||
"T", | ||
avalue(), | ||
closed=true), | ||
[ | ||
avalue(), | ||
aloc() | ||
], | ||
[]), | ||
[areified( | ||
aparameter( | ||
"T", | ||
avalue(), | ||
closed=false), | ||
alabel="grammar")], | ||
[], | ||
returnsViaAllPath=true, | ||
abstractFingerprint=0, | ||
alabel="parser") | ||
, | ||
|
||
acons( | ||
aadt( | ||
"LanguageService", | ||
[], | ||
dataSyntax()), | ||
[afunc( | ||
alist(aadt( | ||
"DocumentSymbol", | ||
[], | ||
dataSyntax())), | ||
[aadt( | ||
"Tree", | ||
[], | ||
dataSyntax())], | ||
[], | ||
alabel="outliner")], | ||
[]) | ||
); | ||
|
||
|
||
AType a3() = alub( | ||
afunc( | ||
aparameter( | ||
"T", | ||
avalue(), | ||
closed=true), | ||
[ | ||
avalue(), | ||
aloc() | ||
], | ||
[]) | ||
, | ||
|
||
afunc( | ||
alist(aadt( | ||
"DocumentSymbol", | ||
[], | ||
dataSyntax())), | ||
[aadt( | ||
"Tree", | ||
[], | ||
dataSyntax())], | ||
[], | ||
alabel="outliner") | ||
); | ||
|
||
|
||
AType a4() = alub( | ||
aparameter( | ||
"T", | ||
avalue(), | ||
closed=true) | ||
, | ||
alist(aadt( | ||
"DocumentSymbol", | ||
[], | ||
dataSyntax())) | ||
); |