Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -1593,3 +1593,6 @@
[submodule "vendor/grammars/zephir-sublime"]
path = vendor/grammars/zephir-sublime
url = https://github.com/phalcon/zephir-sublime
[submodule "vendor/grammars/lox-language"]
path = vendor/grammars/lox-language
url = https://github.com/danman113/lox-language.git
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ vendor/grammars/logos:
- source.logos
vendor/grammars/logtalk.tmbundle:
- source.logtalk
vendor/grammars/lox-language:
- source.lox
vendor/grammars/lua.tmbundle:
- source.lua
vendor/grammars/m3:
Expand Down
10 changes: 9 additions & 1 deletion lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4357,6 +4357,14 @@ LoomScript:
tm_scope: source.loomscript
ace_mode: text
language_id: 212
Lox:
type: programming
extensions:
- ".lox"
tm_scope: source.lox
ace_mode: text
color: "#f1ead7"
language_id: 640917978
Lua:
type: programming
tm_scope: source.lua
Expand Down Expand Up @@ -7682,7 +7690,7 @@ TMDL:
extensions:
- ".tmdl"
aliases:
- "Tabular Model Definition Language"
- Tabular Model Definition Language
tm_scope: source.tmdl
ace_mode: text
language_id: 769162295
Expand Down
11 changes: 11 additions & 0 deletions samples/Lox/fibonacci_numbers.lox
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Amount of digits
var n = 10;

var a = 0;
var b = 1;
for (var i = 0; i < n; i = i + 1) {
print a;
var temp = a;
a = b;
b = temp + b;
}
22 changes: 22 additions & 0 deletions samples/Lox/inherited_method.lox
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class Foo {
inFoo() {
print "in foo";
}
}

class Bar < Foo {
inBar() {
print "in bar";
}
}

class Baz < Bar {
inBaz() {
print "in baz";
}
}

var baz = Baz();
baz.inFoo(); // expect: in foo
baz.inBar(); // expect: in bar
baz.inBaz(); // expect: in baz
1 change: 1 addition & 0 deletions vendor/grammars/lox-language
Submodule lox-language added at eb6a23