Skip to content

Commit

Permalink
add phix support (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
petelomax authored Jun 12, 2024
1 parent 9527124 commit d91a200
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ Perl
Perl6
Pest
Smalltalk
Phix
Php
Poke
Polly
Expand Down
8 changes: 8 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,14 @@
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["pest"]
},
"Phix": {
"line_comment": ["--", "//", "#!"],
"multi_line_comments": [["/*", "*/"], ["--/*", "--*/"]],
"nested": true,
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"verbatim_quotes": [["\\\"\\\"\\\"", "\\\"\\\"\\\""], ["`", "`"]],
"extensions": ["e","exw"]
},
"Php": {
"name": "PHP",
"line_comment": ["#", "//"],
Expand Down
40 changes: 40 additions & 0 deletions tests/data/phix.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* 40 lines 25 code 8 comments 7 blanks */

-- copied from cpp, not necessarily idiomatic Euphoria code

include std/sequence.e

-- bubble_sort_function
public function bubble_sort(sequence a)
integer t = 0
integer j = length(a)
integer s = 1
while s > 0 do
s = 0
integer i = 2
while i <= j do
if a[i] < a[i - 1] then
t = a[i]
a[i] = a[i - 1]
a[i - 1] = t
s = 1
end if
i += 1
end while
j -= 1
end while
return a
end function

sequence a = {4, 65, 2, -31, 0, 99, 2, 83, 782, 1}

-- Single line comment
? {"Before:", a}

a = bubble_sort(a)

/* multi
* line
* comment
*/
? {"After:", a, equal(a, {-31,0,1,2,2,4,65,83,99,782})}

0 comments on commit d91a200

Please sign in to comment.