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

Add .wx extension to Monkey language #5964

Closed
wants to merge 11 commits into from
1 change: 1 addition & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4010,6 +4010,7 @@ Monkey:
extensions:
- ".monkey"
- ".monkey2"
- ".wx"
ace_mode: text
tm_scope: source.monkey
language_id: 236
Expand Down
26 changes: 26 additions & 0 deletions samples/Monkey/vec2.wx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
struct Vec2<T>
field x:T
field y:T

method new( x:T, y:T )
self.x = x
self.y = y
end

operator+:Vec2( v:Vec2 )
return new Vec2( x + v.x, y + v.y )
end

operator to:string()
return "Vec2(" + x + ", " + y + ")"
end
end

alias Vec2<float> Vec2f

'main entry
function main()
local v0:= new Vec2f( 10,20 )
local v1:= new Vec2f( 30,40 )
print v0 + v1
end