-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pony markup tests + language improvements (#1958)
* Added some tests. Still not happy with class definition highlighting * Got class highlighting working as I would like and added additional tests
- Loading branch information
1 parent
5b5e907
commit 6ffbe78
Showing
13 changed files
with
71 additions
and
2 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,3 @@ | ||
<span class="hljs-function"><span class="hljs-keyword">new</span> <span class="hljs-title">create</span>(env: <span class="hljs-type">Env</span>, name: <span class="hljs-type">String</span>) =></span> | ||
_env = env | ||
_name = name |
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,3 @@ | ||
new create(env: Env, name: String) => | ||
_env = env | ||
_name = name |
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 @@ | ||
{(foo: <span class="hljs-type">I32</span>)(bar): <span class="hljs-type">String</span> => (foo + bar).string()} |
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 @@ | ||
{(foo: I32)(bar): String => (foo + bar).string()} |
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,8 @@ | ||
<span class="hljs-keyword">match</span> foo | ||
| <span class="hljs-literal">true</span> => <span class="hljs-string">"it's true"</span> | ||
| <span class="hljs-string">"bar"</span> => <span class="hljs-string">"it's bar"</span> | ||
| <span class="hljs-keyword">let</span> x: <span class="hljs-type">I32</span> <span class="hljs-keyword">if</span> x > <span class="hljs-number">3</span> => <span class="hljs-string">"it's greater than 3"</span> | ||
| <span class="hljs-keyword">let</span> x: <span class="hljs-type">I32</span> => <span class="hljs-string">"it's less than or equal to 3"</span> | ||
<span class="hljs-keyword">else</span> | ||
<span class="hljs-string">"I don't know what it is"</span> | ||
<span class="hljs-keyword">end</span> |
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,8 @@ | ||
match foo | ||
| true => "it's true" | ||
| "bar" => "it's bar" | ||
| let x: I32 if x > 3 => "it's greater than 3" | ||
| let x: I32 => "it's less than or equal to 3" | ||
else | ||
"I don't know what it is" | ||
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,8 @@ | ||
<span class="hljs-function"><span class="hljs-keyword">fun</span> <span class="hljs-title">foo</span>(bar: <span class="hljs-type">String</span>): <span class="hljs-type">String</span> =></span> | ||
bar + <span class="hljs-string">"baz"</span> | ||
|
||
<span class="hljs-function"><span class="hljs-keyword">new</span> <span class="hljs-title">create</span>(hunger: <span class="hljs-type">I32</span>) =></span> | ||
_hunger = hunger | ||
|
||
<span class="hljs-function"><span class="hljs-keyword">be</span> <span class="hljs-title">feed</span>(food: <span class="hljs-type">I32</span>) =></span> | ||
_hunger = _hunger - food |
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,8 @@ | ||
fun foo(bar: String): String => | ||
bar + "baz" | ||
|
||
new create(hunger: I32) => | ||
_hunger = hunger | ||
|
||
be feed(food: I32) => | ||
_hunger = _hunger - food |
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 @@ | ||
<span class="hljs-class"><span class="hljs-keyword">primitive</span> <span class="hljs-type">I32</span> <span class="hljs-keyword">is</span> <span class="hljs-type">SignedInteger</span></span> | ||
|
||
<span class="hljs-class"><span class="hljs-keyword">actor</span> <span class="hljs-type">Main</span></span> | ||
|
||
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ref</span> <span class="hljs-type">List</span>[<span class="hljs-type">A</span>: <span class="hljs-type">A</span>] <span class="hljs-keyword">is</span> <span class="hljs-type">Seq</span>[<span class="hljs-type">A</span>] <span class="hljs-title">ref</span></span> | ||
|
||
<span class="hljs-class"><span class="hljs-keyword">object</span> <span class="hljs-keyword">is</span> <span class="hljs-type">Hashable</span></span> |
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 @@ | ||
primitive I32 is SignedInteger | ||
|
||
actor Main | ||
|
||
class ref List[A: A] is Seq[A] ref | ||
|
||
object is Hashable |
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,5 @@ | ||
<span class="hljs-string">""" | ||
A triple quoted string | ||
* Goes several lines | ||
* Keeps formatting | ||
"""</span> |
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,5 @@ | ||
""" | ||
A triple quoted string | ||
* Goes several lines | ||
* Keeps formatting | ||
""" |