-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: jansul <jon@sul.ly> Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
- Loading branch information
1 parent
d04f5c0
commit 5acd5b8
Showing
24 changed files
with
228 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
component Main { | ||
fun test (argument1 : String, argument2: Number) : Html { | ||
<div/> | ||
} | ||
|
||
fun render : Html { | ||
test(argument2: 0, argument1: "") | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
class A extends _C { | ||
a(b, c) { | ||
return _h("div", {}); | ||
} | ||
|
||
render() { | ||
return this.a(``, 0); | ||
} | ||
}; | ||
|
||
A.displayName = "Main"; |
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,39 @@ | ||
component Main { | ||
fun test (argument1 : String, argument2: Number) : Html { | ||
<div/> | ||
} | ||
|
||
fun render : Html { | ||
test(argument2: 0, argument1: "") | ||
} | ||
} | ||
---------------------------------------------------------CallWithMixedArguments | ||
component Main { | ||
fun test (argument1 : String, argument2: Number) : Html { | ||
<div/> | ||
} | ||
|
||
fun render : Html { | ||
test(0, argument1: "") | ||
} | ||
} | ||
---------------------------------------------------------CallWithMixedArguments | ||
component Main { | ||
fun test (argument1 : String, argument2: Number) : Html { | ||
<div/> | ||
} | ||
|
||
fun render : Html { | ||
test(argument2: 0, "") | ||
} | ||
} | ||
-----------------------------------------------------------CallNotFoundArgument | ||
component Main { | ||
fun test (argument1 : String, argument2: Number) : Html { | ||
<div/> | ||
} | ||
|
||
fun render : Html { | ||
test(argument3: 0, argument1: "") | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Mint | ||
class Ast | ||
class CallExpression < Node | ||
getter name, expression | ||
|
||
def initialize(@expression : Expression, | ||
@name : Variable?, | ||
@input : Data, | ||
@from : Int32, | ||
@to : Int32) | ||
end | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Mint | ||
class Compiler | ||
def _compile(node : Ast::CallExpression) | ||
compile node.expression | ||
end | ||
end | ||
end |
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,14 @@ | ||
module Mint | ||
class Formatter | ||
def format(node : Ast::CallExpression) | ||
expression = | ||
format node.expression | ||
|
||
if name = node.name | ||
"#{name.value}: #{expression}" | ||
else | ||
expression | ||
end | ||
end | ||
end | ||
end |
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,13 @@ | ||
message CallNotFoundArgument do | ||
title "Type Error" | ||
|
||
block do | ||
text "I was looking for the argument:" | ||
bold name | ||
text "but it's not there." | ||
end | ||
|
||
type_with_text function_type, "The type of the function is:" | ||
|
||
snippet node, "The call is here:" | ||
end |
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,9 @@ | ||
message CallWithMixedArguments do | ||
title "Type Error" | ||
|
||
block do | ||
text "A call cannot have named and unamed arguments at the same time." | ||
end | ||
|
||
snippet node, "It is here:" | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module Mint | ||
class Parser | ||
def call_expression : Ast::CallExpression? | ||
start do |start_position| | ||
name = | ||
start do | ||
next unless key = variable | ||
whitespace | ||
|
||
next unless char! ':' | ||
whitespace | ||
|
||
key | ||
end | ||
|
||
return unless expression = self.expression | ||
|
||
Ast::CallExpression.new( | ||
expression: expression, | ||
from: start_position, | ||
to: position, | ||
input: data, | ||
name: name) | ||
end | ||
end | ||
end | ||
end |
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
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.