This commit is contained in:
Pete Lomax 2024-09-30 09:45:47 +01:00 committed by GitHub
parent 2b1752ee09
commit 4faf752140
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 49 additions and 0 deletions

View File

@ -485,6 +485,7 @@ Pascal
Perl
Perl6
Pest
Phix
Php
Po
Poke

View File

@ -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": ["#", "//"],

40
tests/data/phix.e Normal file
View File

@ -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})}