mirror of https://github.com/XAMPPRocky/tokei
Add Phix (#1167)
This commit is contained in:
parent
2b1752ee09
commit
4faf752140
|
|
@ -1230,6 +1230,14 @@
|
|||
"quotes": [["\\\"", "\\\""], ["'", "'"]],
|
||||
"extensions": ["pest"]
|
||||
},
|
||||
"Phix": {
|
||||
"line_comment": ["--", "//", "#!"],
|
||||
"multi_line_comments": [["/*", "*/"], ["--/*", "--*/"]],
|
||||
"nested": true,
|
||||
"quotes": [["\\\"", "\\\""], ["'", "'"]],
|
||||
"verbatim_quotes": [["\\\"\\\"\\\"", "\\\"\\\"\\\""], ["`", "`"]],
|
||||
"extensions": ["e","exw"]
|
||||
},
|
||||
"Php": {
|
||||
"name": "PHP",
|
||||
"line_comment": ["#", "//"],
|
||||
|
|
|
|||
|
|
@ -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})}
|
||||
Loading…
Reference in New Issue