OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
pygments
/
lexers
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/08/2024 06:42:35 PM
rwxr-xr-x
📄
__init__.py
11.78 KB
05/08/2024 06:42:35 PM
rw-r--r--
📁
__pycache__
-
05/08/2024 06:42:35 PM
rwxr-xr-x
📄
_ada_builtins.py
1.51 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_asy_builtins.py
26.65 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_cl_builtins.py
13.67 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_cocoa_builtins.py
102.71 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_csound_builtins.py
17.98 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_css_builtins.py
12.15 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_julia_builtins.py
11.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_lasso_builtins.py
131.36 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_lilypond_builtins.py
105.56 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_lua_builtins.py
7.92 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_luau_builtins.py
955 bytes
05/08/2024 06:42:35 PM
rw-r--r--
📄
_mapping.py
67.47 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_mql_builtins.py
24.13 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_mysql_builtins.py
25.23 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_openedge_builtins.py
48.24 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_php_builtins.py
105.39 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_postgres_builtins.py
13.03 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_qlik_builtins.py
12.3 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_scheme_builtins.py
31.8 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_scilab_builtins.py
51.18 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_sourcemod_builtins.py
26.15 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_stan_builtins.py
13.13 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_stata_builtins.py
26.59 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_tsql_builtins.py
15.1 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_usd_builtins.py
1.62 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_vbscript_builtins.py
4.13 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
_vim_builtins.py
55.73 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
actionscript.py
11.45 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ada.py
5.23 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
agile.py
896 bytes
05/08/2024 06:42:35 PM
rw-r--r--
📄
algebra.py
9.68 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ambient.py
2.54 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
amdgpu.py
1.68 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ampl.py
4.08 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
apdlexer.py
30.08 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
apl.py
3.32 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
archetype.py
11.27 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
arrow.py
3.48 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
arturo.py
11.15 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
asc.py
1.65 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
asm.py
40.95 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
asn1.py
4.16 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
automation.py
19.37 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
bare.py
2.95 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
basic.py
27.33 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
bdd.py
1.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
berry.py
3.13 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
bibtex.py
4.7 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
blueprint.py
6.04 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
boa.py
3.83 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
bqn.py
3.26 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
business.py
27.68 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
c_cpp.py
17.64 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
c_like.py
31.27 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
capnproto.py
2.12 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
carbon.py
3.14 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
cddl.py
4.96 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
chapel.py
5.04 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
clean.py
6.27 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
comal.py
3.1 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
compiled.py
1.39 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
configs.py
49.35 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
console.py
4.08 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
cplint.py
1.36 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
crystal.py
15.38 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
csound.py
16.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
css.py
24.77 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
d.py
9.69 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
dalvik.py
4.5 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
data.py
26.39 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
dax.py
7.91 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
devicetree.py
3.92 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
diff.py
5.26 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
dns.py
3.8 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
dotnet.py
37.07 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
dsls.py
35.88 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
dylan.py
10.15 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ecl.py
6.22 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
eiffel.py
2.63 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
elm.py
3.08 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
elpi.py
6.38 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
email.py
4.69 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
erlang.py
18.7 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
esoteric.py
10.25 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ezhil.py
3.2 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
factor.py
19.07 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
fantom.py
9.99 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
felix.py
9.43 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
fift.py
1.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
floscript.py
2.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
forth.py
7.02 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
fortran.py
10.14 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
foxpro.py
25.68 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
freefem.py
26.28 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
func.py
3.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
functional.py
693 bytes
05/08/2024 06:42:35 PM
rw-r--r--
📄
futhark.py
3.66 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
gcodelexer.py
874 bytes
05/08/2024 06:42:35 PM
rw-r--r--
📄
gdscript.py
7.39 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
go.py
3.69 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
grammar_notation.py
7.85 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
graph.py
4.01 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
graphics.py
38.23 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
graphql.py
5.47 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
graphviz.py
1.89 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
gsql.py
3.9 KB
05/08/2024 06:42:35 PM
rwxr-xr-x
📄
haskell.py
32.46 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
haxe.py
30.25 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
hdl.py
22.21 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
hexdump.py
3.57 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
html.py
20.09 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
idl.py
15.09 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
igor.py
30.88 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
inferno.py
3.06 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
installers.py
12.99 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
int_fiction.py
55.22 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
iolang.py
1.86 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
j.py
4.74 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
javascript.py
61.62 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
jmespath.py
2.03 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
jslt.py
3.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
jsonnet.py
5.5 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
jsx.py
2.18 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
julia.py
11.41 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
jvm.py
70.96 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
kuin.py
11.14 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
kusto.py
3.4 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ldap.py
6.4 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
lean.py
8.37 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
lilypond.py
9.52 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
lisp.py
153.97 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
macaulay2.py
32.07 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
make.py
7.65 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
markup.py
63.56 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
math.py
695 bytes
05/08/2024 06:42:35 PM
rw-r--r--
📄
matlab.py
129.85 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
maxima.py
2.65 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
meson.py
4.23 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
mime.py
7.4 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
minecraft.py
13.38 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
mips.py
4.55 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ml.py
34.56 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
modeling.py
13.36 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
modula2.py
51.83 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
mojo.py
23.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
monte.py
6.14 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
mosel.py
9.08 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ncl.py
62.5 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
nimrod.py
6.26 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
nit.py
2.66 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
nix.py
4.32 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
oberon.py
4.11 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
objective.py
22.7 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ooc.py
2.91 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
openscad.py
3.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
other.py
1.72 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
parasail.py
2.66 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
parsers.py
25.97 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
pascal.py
30.26 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
pawn.py
8.06 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
perl.py
38.27 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
phix.py
22.7 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
php.py
12.75 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
pointless.py
1.93 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
pony.py
3.2 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
praat.py
12.38 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
procfile.py
1.13 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
prolog.py
12.56 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
promql.py
4.63 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
prql.py
8.54 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ptx.py
4.4 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
python.py
52.38 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
q.py
6.77 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
qlik.py
3.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
qvt.py
5.96 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
r.py
6.19 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
rdf.py
15.67 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
rebol.py
17.83 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
resource.py
2.86 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ride.py
4.92 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
rita.py
1.1 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
rnc.py
1.93 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
roboconf.py
2.03 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
robotframework.py
18.02 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ruby.py
22.22 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
rust.py
8.07 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
sas.py
9.23 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
savi.py
4.76 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
scdoc.py
2.46 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
scripting.py
79.16 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
sgf.py
1.94 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
shell.py
35.38 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
sieve.py
2.46 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
slash.py
8.29 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
smalltalk.py
7.04 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
smithy.py
2.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
smv.py
2.74 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
snobol.py
2.71 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
solidity.py
3.09 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
soong.py
2.28 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
sophia.py
3.3 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
special.py
3.47 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
spice.py
2.72 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
sql.py
41.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
srcinfo.py
1.71 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
stata.py
6.26 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
supercollider.py
3.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
tact.py
10.56 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
tal.py
2.84 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
tcl.py
5.38 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
teal.py
3.44 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
templates.py
73.94 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
teraterm.py
9.49 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
testing.py
10.56 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
text.py
1.02 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
textedit.py
7.58 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
textfmts.py
15.16 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
theorem.py
17.44 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
thingsdb.py
5.88 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
tlb.py
1.42 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
tls.py
1.5 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
tnt.py
10.21 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
trafficscript.py
1.47 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
typoscript.py
8.14 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
typst.py
4.24 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
ul4.py
10.25 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
unicon.py
18.19 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
urbi.py
5.94 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
usd.py
3.23 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
varnish.py
7.3 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
verification.py
3.84 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
verifpal.py
2.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
vip.py
5.58 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
vyper.py
5.46 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
web.py
913 bytes
05/08/2024 06:42:35 PM
rw-r--r--
📄
webassembly.py
5.56 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
webidl.py
10.27 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
webmisc.py
39.61 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
wgsl.py
11.6 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
whiley.py
3.92 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
wowtoc.py
3.98 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
wren.py
3.15 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
x10.py
1.9 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
xorg.py
925 bytes
05/08/2024 06:42:35 PM
rw-r--r--
📄
yang.py
4.39 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
yara.py
2.37 KB
05/08/2024 06:42:35 PM
rw-r--r--
📄
zig.py
3.88 KB
05/08/2024 06:42:35 PM
rw-r--r--
Editing: haxe.py
Close
""" pygments.lexers.haxe ~~~~~~~~~~~~~~~~~~~~ Lexers for Haxe and related stuff. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, bygroups, \ default from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ Number, Punctuation, Generic, Whitespace __all__ = ['HaxeLexer', 'HxmlLexer'] class HaxeLexer(ExtendedRegexLexer): """ For Haxe source code. """ name = 'Haxe' url = 'http://haxe.org/' aliases = ['haxe', 'hxsl', 'hx'] filenames = ['*.hx', '*.hxsl'] mimetypes = ['text/haxe', 'text/x-haxe', 'text/x-hx'] version_added = '1.3' # keywords extracted from lexer.mll in the haxe compiler source keyword = (r'(?:function|class|static|var|if|else|while|do|for|' r'break|return|continue|extends|implements|import|' r'switch|case|default|public|private|try|untyped|' r'catch|new|this|throw|extern|enum|in|interface|' r'cast|override|dynamic|typedef|package|' r'inline|using|null|true|false|abstract)\b') # idtype in lexer.mll typeid = r'_*[A-Z]\w*' # combined ident and dollar and idtype ident = r'(?:_*[a-z]\w*|_+[0-9]\w*|' + typeid + r'|_+|\$\w+)' binop = (r'(?:%=|&=|\|=|\^=|\+=|\-=|\*=|/=|<<=|>\s*>\s*=|>\s*>\s*>\s*=|==|' r'!=|<=|>\s*=|&&|\|\||<<|>>>|>\s*>|\.\.\.|<|>|%|&|\||\^|\+|\*|' r'/|\-|=>|=)') # ident except keywords ident_no_keyword = r'(?!' + keyword + ')' + ident flags = re.DOTALL | re.MULTILINE preproc_stack = [] def preproc_callback(self, match, ctx): proc = match.group(2) if proc == 'if': # store the current stack self.preproc_stack.append(ctx.stack[:]) elif proc in ['else', 'elseif']: # restore the stack back to right before #if if self.preproc_stack: ctx.stack = self.preproc_stack[-1][:] elif proc == 'end': # remove the saved stack of previous #if if self.preproc_stack: self.preproc_stack.pop() # #if and #elseif should follow by an expr if proc in ['if', 'elseif']: ctx.stack.append('preproc-expr') # #error can be optionally follow by the error msg if proc in ['error']: ctx.stack.append('preproc-error') yield match.start(), Comment.Preproc, '#' + proc ctx.pos = match.end() tokens = { 'root': [ include('spaces'), include('meta'), (r'(?:package)\b', Keyword.Namespace, ('semicolon', 'package')), (r'(?:import)\b', Keyword.Namespace, ('semicolon', 'import')), (r'(?:using)\b', Keyword.Namespace, ('semicolon', 'using')), (r'(?:extern|private)\b', Keyword.Declaration), (r'(?:abstract)\b', Keyword.Declaration, 'abstract'), (r'(?:class|interface)\b', Keyword.Declaration, 'class'), (r'(?:enum)\b', Keyword.Declaration, 'enum'), (r'(?:typedef)\b', Keyword.Declaration, 'typedef'), # top-level expression # although it is not supported in haxe, but it is common to write # expression in web pages the positive lookahead here is to prevent # an infinite loop at the EOF (r'(?=.)', Text, 'expr-statement'), ], # space/tab/comment/preproc 'spaces': [ (r'\s+', Whitespace), (r'//[^\n\r]*', Comment.Single), (r'/\*.*?\*/', Comment.Multiline), (r'(#)(if|elseif|else|end|error)\b', preproc_callback), ], 'string-single-interpol': [ (r'\$\{', String.Interpol, ('string-interpol-close', 'expr')), (r'\$\$', String.Escape), (r'\$(?=' + ident + ')', String.Interpol, 'ident'), include('string-single'), ], 'string-single': [ (r"'", String.Single, '#pop'), (r'\\.', String.Escape), (r'.', String.Single), ], 'string-double': [ (r'"', String.Double, '#pop'), (r'\\.', String.Escape), (r'.', String.Double), ], 'string-interpol-close': [ (r'\$'+ident, String.Interpol), (r'\}', String.Interpol, '#pop'), ], 'package': [ include('spaces'), (ident, Name.Namespace), (r'\.', Punctuation, 'import-ident'), default('#pop'), ], 'import': [ include('spaces'), (ident, Name.Namespace), (r'\*', Keyword), # wildcard import (r'\.', Punctuation, 'import-ident'), (r'in', Keyword.Namespace, 'ident'), default('#pop'), ], 'import-ident': [ include('spaces'), (r'\*', Keyword, '#pop'), # wildcard import (ident, Name.Namespace, '#pop'), ], 'using': [ include('spaces'), (ident, Name.Namespace), (r'\.', Punctuation, 'import-ident'), default('#pop'), ], 'preproc-error': [ (r'\s+', Whitespace), (r"'", String.Single, ('#pop', 'string-single')), (r'"', String.Double, ('#pop', 'string-double')), default('#pop'), ], 'preproc-expr': [ (r'\s+', Whitespace), (r'\!', Comment.Preproc), (r'\(', Comment.Preproc, ('#pop', 'preproc-parenthesis')), (ident, Comment.Preproc, '#pop'), # Float (r'\.[0-9]+', Number.Float), (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float), (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float), (r'[0-9]+\.[0-9]+', Number.Float), (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float), # Int (r'0x[0-9a-fA-F]+', Number.Hex), (r'[0-9]+', Number.Integer), # String (r"'", String.Single, ('#pop', 'string-single')), (r'"', String.Double, ('#pop', 'string-double')), ], 'preproc-parenthesis': [ (r'\s+', Whitespace), (r'\)', Comment.Preproc, '#pop'), default('preproc-expr-in-parenthesis'), ], 'preproc-expr-chain': [ (r'\s+', Whitespace), (binop, Comment.Preproc, ('#pop', 'preproc-expr-in-parenthesis')), default('#pop'), ], # same as 'preproc-expr' but able to chain 'preproc-expr-chain' 'preproc-expr-in-parenthesis': [ (r'\s+', Whitespace), (r'\!', Comment.Preproc), (r'\(', Comment.Preproc, ('#pop', 'preproc-expr-chain', 'preproc-parenthesis')), (ident, Comment.Preproc, ('#pop', 'preproc-expr-chain')), # Float (r'\.[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), (r'[0-9]+\.[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float, ('#pop', 'preproc-expr-chain')), # Int (r'0x[0-9a-fA-F]+', Number.Hex, ('#pop', 'preproc-expr-chain')), (r'[0-9]+', Number.Integer, ('#pop', 'preproc-expr-chain')), # String (r"'", String.Single, ('#pop', 'preproc-expr-chain', 'string-single')), (r'"', String.Double, ('#pop', 'preproc-expr-chain', 'string-double')), ], 'abstract': [ include('spaces'), default(('#pop', 'abstract-body', 'abstract-relation', 'abstract-opaque', 'type-param-constraint', 'type-name')), ], 'abstract-body': [ include('spaces'), (r'\{', Punctuation, ('#pop', 'class-body')), ], 'abstract-opaque': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'parenthesis-close', 'type')), default('#pop'), ], 'abstract-relation': [ include('spaces'), (r'(?:to|from)', Keyword.Declaration, 'type'), (r',', Punctuation), default('#pop'), ], 'meta': [ include('spaces'), (r'@', Name.Decorator, ('meta-body', 'meta-ident', 'meta-colon')), ], # optional colon 'meta-colon': [ include('spaces'), (r':', Name.Decorator, '#pop'), default('#pop'), ], # same as 'ident' but set token as Name.Decorator instead of Name 'meta-ident': [ include('spaces'), (ident, Name.Decorator, '#pop'), ], 'meta-body': [ include('spaces'), (r'\(', Name.Decorator, ('#pop', 'meta-call')), default('#pop'), ], 'meta-call': [ include('spaces'), (r'\)', Name.Decorator, '#pop'), default(('#pop', 'meta-call-sep', 'expr')), ], 'meta-call-sep': [ include('spaces'), (r'\)', Name.Decorator, '#pop'), (r',', Punctuation, ('#pop', 'meta-call')), ], 'typedef': [ include('spaces'), default(('#pop', 'typedef-body', 'type-param-constraint', 'type-name')), ], 'typedef-body': [ include('spaces'), (r'=', Operator, ('#pop', 'optional-semicolon', 'type')), ], 'enum': [ include('spaces'), default(('#pop', 'enum-body', 'bracket-open', 'type-param-constraint', 'type-name')), ], 'enum-body': [ include('spaces'), include('meta'), (r'\}', Punctuation, '#pop'), (ident_no_keyword, Name, ('enum-member', 'type-param-constraint')), ], 'enum-member': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'semicolon', 'flag', 'function-param')), default(('#pop', 'semicolon', 'flag')), ], 'class': [ include('spaces'), default(('#pop', 'class-body', 'bracket-open', 'extends', 'type-param-constraint', 'type-name')), ], 'extends': [ include('spaces'), (r'(?:extends|implements)\b', Keyword.Declaration, 'type'), (r',', Punctuation), # the comma is made optional here, since haxe2 # requires the comma but haxe3 does not allow it default('#pop'), ], 'bracket-open': [ include('spaces'), (r'\{', Punctuation, '#pop'), ], 'bracket-close': [ include('spaces'), (r'\}', Punctuation, '#pop'), ], 'class-body': [ include('spaces'), include('meta'), (r'\}', Punctuation, '#pop'), (r'(?:static|public|private|override|dynamic|inline|macro)\b', Keyword.Declaration), default('class-member'), ], 'class-member': [ include('spaces'), (r'(var)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'var')), (r'(function)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'class-method')), ], # local function, anonymous or not 'function-local': [ include('spaces'), (ident_no_keyword, Name.Function, ('#pop', 'optional-expr', 'flag', 'function-param', 'parenthesis-open', 'type-param-constraint')), default(('#pop', 'optional-expr', 'flag', 'function-param', 'parenthesis-open', 'type-param-constraint')), ], 'optional-expr': [ include('spaces'), include('expr'), default('#pop'), ], 'class-method': [ include('spaces'), (ident, Name.Function, ('#pop', 'optional-expr', 'flag', 'function-param', 'parenthesis-open', 'type-param-constraint')), ], # function arguments 'function-param': [ include('spaces'), (r'\)', Punctuation, '#pop'), (r'\?', Punctuation), (ident_no_keyword, Name, ('#pop', 'function-param-sep', 'assign', 'flag')), ], 'function-param-sep': [ include('spaces'), (r'\)', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'function-param')), ], 'prop-get-set': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'parenthesis-close', 'prop-get-set-opt', 'comma', 'prop-get-set-opt')), default('#pop'), ], 'prop-get-set-opt': [ include('spaces'), (r'(?:default|null|never|dynamic|get|set)\b', Keyword, '#pop'), (ident_no_keyword, Text, '#pop'), # custom getter/setter ], 'expr-statement': [ include('spaces'), # makes semicolon optional here, just to avoid checking the last # one is bracket or not. default(('#pop', 'optional-semicolon', 'expr')), ], 'expr': [ include('spaces'), (r'@', Name.Decorator, ('#pop', 'optional-expr', 'meta-body', 'meta-ident', 'meta-colon')), (r'(?:\+\+|\-\-|~(?!/)|!|\-)', Operator), (r'\(', Punctuation, ('#pop', 'expr-chain', 'parenthesis')), (r'(?:static|public|private|override|dynamic|inline)\b', Keyword.Declaration), (r'(?:function)\b', Keyword.Declaration, ('#pop', 'expr-chain', 'function-local')), (r'\{', Punctuation, ('#pop', 'expr-chain', 'bracket')), (r'(?:true|false|null)\b', Keyword.Constant, ('#pop', 'expr-chain')), (r'(?:this)\b', Keyword, ('#pop', 'expr-chain')), (r'(?:cast)\b', Keyword, ('#pop', 'expr-chain', 'cast')), (r'(?:try)\b', Keyword, ('#pop', 'catch', 'expr')), (r'(?:var)\b', Keyword.Declaration, ('#pop', 'var')), (r'(?:new)\b', Keyword, ('#pop', 'expr-chain', 'new')), (r'(?:switch)\b', Keyword, ('#pop', 'switch')), (r'(?:if)\b', Keyword, ('#pop', 'if')), (r'(?:do)\b', Keyword, ('#pop', 'do')), (r'(?:while)\b', Keyword, ('#pop', 'while')), (r'(?:for)\b', Keyword, ('#pop', 'for')), (r'(?:untyped|throw)\b', Keyword), (r'(?:return)\b', Keyword, ('#pop', 'optional-expr')), (r'(?:macro)\b', Keyword, ('#pop', 'macro')), (r'(?:continue|break)\b', Keyword, '#pop'), (r'(?:\$\s*[a-z]\b|\$(?!'+ident+'))', Name, ('#pop', 'dollar')), (ident_no_keyword, Name, ('#pop', 'expr-chain')), # Float (r'\.[0-9]+', Number.Float, ('#pop', 'expr-chain')), (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'expr-chain')), (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'expr-chain')), (r'[0-9]+\.[0-9]+', Number.Float, ('#pop', 'expr-chain')), (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float, ('#pop', 'expr-chain')), # Int (r'0x[0-9a-fA-F]+', Number.Hex, ('#pop', 'expr-chain')), (r'[0-9]+', Number.Integer, ('#pop', 'expr-chain')), # String (r"'", String.Single, ('#pop', 'expr-chain', 'string-single-interpol')), (r'"', String.Double, ('#pop', 'expr-chain', 'string-double')), # EReg (r'~/(\\\\|\\[^\\]|[^/\\\n])*/[gimsu]*', String.Regex, ('#pop', 'expr-chain')), # Array (r'\[', Punctuation, ('#pop', 'expr-chain', 'array-decl')), ], 'expr-chain': [ include('spaces'), (r'(?:\+\+|\-\-)', Operator), (binop, Operator, ('#pop', 'expr')), (r'(?:in)\b', Keyword, ('#pop', 'expr')), (r'\?', Operator, ('#pop', 'expr', 'ternary', 'expr')), (r'(\.)(' + ident_no_keyword + ')', bygroups(Punctuation, Name)), (r'\[', Punctuation, 'array-access'), (r'\(', Punctuation, 'call'), default('#pop'), ], # macro reification 'macro': [ include('spaces'), include('meta'), (r':', Punctuation, ('#pop', 'type')), (r'(?:extern|private)\b', Keyword.Declaration), (r'(?:abstract)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'abstract')), (r'(?:class|interface)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'macro-class')), (r'(?:enum)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'enum')), (r'(?:typedef)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'typedef')), default(('#pop', 'expr')), ], 'macro-class': [ (r'\{', Punctuation, ('#pop', 'class-body')), include('class') ], # cast can be written as "cast expr" or "cast(expr, type)" 'cast': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'parenthesis-close', 'cast-type', 'expr')), default(('#pop', 'expr')), ], # optionally give a type as the 2nd argument of cast() 'cast-type': [ include('spaces'), (r',', Punctuation, ('#pop', 'type')), default('#pop'), ], 'catch': [ include('spaces'), (r'(?:catch)\b', Keyword, ('expr', 'function-param', 'parenthesis-open')), default('#pop'), ], # do-while loop 'do': [ include('spaces'), default(('#pop', 'do-while', 'expr')), ], # the while after do 'do-while': [ include('spaces'), (r'(?:while)\b', Keyword, ('#pop', 'parenthesis', 'parenthesis-open')), ], 'while': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'expr', 'parenthesis')), ], 'for': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'expr', 'parenthesis')), ], 'if': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'else', 'optional-semicolon', 'expr', 'parenthesis')), ], 'else': [ include('spaces'), (r'(?:else)\b', Keyword, ('#pop', 'expr')), default('#pop'), ], 'switch': [ include('spaces'), default(('#pop', 'switch-body', 'bracket-open', 'expr')), ], 'switch-body': [ include('spaces'), (r'(?:case|default)\b', Keyword, ('case-block', 'case')), (r'\}', Punctuation, '#pop'), ], 'case': [ include('spaces'), (r':', Punctuation, '#pop'), default(('#pop', 'case-sep', 'case-guard', 'expr')), ], 'case-sep': [ include('spaces'), (r':', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'case')), ], 'case-guard': [ include('spaces'), (r'(?:if)\b', Keyword, ('#pop', 'parenthesis', 'parenthesis-open')), default('#pop'), ], # optional multiple expr under a case 'case-block': [ include('spaces'), (r'(?!(?:case|default)\b|\})', Keyword, 'expr-statement'), default('#pop'), ], 'new': [ include('spaces'), default(('#pop', 'call', 'parenthesis-open', 'type')), ], 'array-decl': [ include('spaces'), (r'\]', Punctuation, '#pop'), default(('#pop', 'array-decl-sep', 'expr')), ], 'array-decl-sep': [ include('spaces'), (r'\]', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'array-decl')), ], 'array-access': [ include('spaces'), default(('#pop', 'array-access-close', 'expr')), ], 'array-access-close': [ include('spaces'), (r'\]', Punctuation, '#pop'), ], 'comma': [ include('spaces'), (r',', Punctuation, '#pop'), ], 'colon': [ include('spaces'), (r':', Punctuation, '#pop'), ], 'semicolon': [ include('spaces'), (r';', Punctuation, '#pop'), ], 'optional-semicolon': [ include('spaces'), (r';', Punctuation, '#pop'), default('#pop'), ], # identity that CAN be a Haxe keyword 'ident': [ include('spaces'), (ident, Name, '#pop'), ], 'dollar': [ include('spaces'), (r'\{', Punctuation, ('#pop', 'expr-chain', 'bracket-close', 'expr')), default(('#pop', 'expr-chain')), ], 'type-name': [ include('spaces'), (typeid, Name, '#pop'), ], 'type-full-name': [ include('spaces'), (r'\.', Punctuation, 'ident'), default('#pop'), ], 'type': [ include('spaces'), (r'\?', Punctuation), (ident, Name, ('#pop', 'type-check', 'type-full-name')), (r'\{', Punctuation, ('#pop', 'type-check', 'type-struct')), (r'\(', Punctuation, ('#pop', 'type-check', 'type-parenthesis')), ], 'type-parenthesis': [ include('spaces'), default(('#pop', 'parenthesis-close', 'type')), ], 'type-check': [ include('spaces'), (r'->', Punctuation, ('#pop', 'type')), (r'<(?!=)', Punctuation, 'type-param'), default('#pop'), ], 'type-struct': [ include('spaces'), (r'\}', Punctuation, '#pop'), (r'\?', Punctuation), (r'>', Punctuation, ('comma', 'type')), (ident_no_keyword, Name, ('#pop', 'type-struct-sep', 'type', 'colon')), include('class-body'), ], 'type-struct-sep': [ include('spaces'), (r'\}', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'type-struct')), ], # type-param can be a normal type or a constant literal... 'type-param-type': [ # Float (r'\.[0-9]+', Number.Float, '#pop'), (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, '#pop'), (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, '#pop'), (r'[0-9]+\.[0-9]+', Number.Float, '#pop'), (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float, '#pop'), # Int (r'0x[0-9a-fA-F]+', Number.Hex, '#pop'), (r'[0-9]+', Number.Integer, '#pop'), # String (r"'", String.Single, ('#pop', 'string-single')), (r'"', String.Double, ('#pop', 'string-double')), # EReg (r'~/(\\\\|\\[^\\]|[^/\\\n])*/[gim]*', String.Regex, '#pop'), # Array (r'\[', Operator, ('#pop', 'array-decl')), include('type'), ], # type-param part of a type # ie. the <A,B> path in Map<A,B> 'type-param': [ include('spaces'), default(('#pop', 'type-param-sep', 'type-param-type')), ], 'type-param-sep': [ include('spaces'), (r'>', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'type-param')), ], # optional type-param that may include constraint # ie. <T:Constraint, T2:(ConstraintA,ConstraintB)> 'type-param-constraint': [ include('spaces'), (r'<(?!=)', Punctuation, ('#pop', 'type-param-constraint-sep', 'type-param-constraint-flag', 'type-name')), default('#pop'), ], 'type-param-constraint-sep': [ include('spaces'), (r'>', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'type-param-constraint-sep', 'type-param-constraint-flag', 'type-name')), ], # the optional constraint inside type-param 'type-param-constraint-flag': [ include('spaces'), (r':', Punctuation, ('#pop', 'type-param-constraint-flag-type')), default('#pop'), ], 'type-param-constraint-flag-type': [ include('spaces'), (r'\(', Punctuation, ('#pop', 'type-param-constraint-flag-type-sep', 'type')), default(('#pop', 'type')), ], 'type-param-constraint-flag-type-sep': [ include('spaces'), (r'\)', Punctuation, '#pop'), (r',', Punctuation, 'type'), ], # a parenthesis expr that contain exactly one expr 'parenthesis': [ include('spaces'), default(('#pop', 'parenthesis-close', 'flag', 'expr')), ], 'parenthesis-open': [ include('spaces'), (r'\(', Punctuation, '#pop'), ], 'parenthesis-close': [ include('spaces'), (r'\)', Punctuation, '#pop'), ], 'var': [ include('spaces'), (ident_no_keyword, Text, ('#pop', 'var-sep', 'assign', 'flag', 'prop-get-set')), ], # optional more var decl. 'var-sep': [ include('spaces'), (r',', Punctuation, ('#pop', 'var')), default('#pop'), ], # optional assignment 'assign': [ include('spaces'), (r'=', Operator, ('#pop', 'expr')), default('#pop'), ], # optional type flag 'flag': [ include('spaces'), (r':', Punctuation, ('#pop', 'type')), default('#pop'), ], # colon as part of a ternary operator (?:) 'ternary': [ include('spaces'), (r':', Operator, '#pop'), ], # function call 'call': [ include('spaces'), (r'\)', Punctuation, '#pop'), default(('#pop', 'call-sep', 'expr')), ], # after a call param 'call-sep': [ include('spaces'), (r'\)', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'call')), ], # bracket can be block or object 'bracket': [ include('spaces'), (r'(?!(?:\$\s*[a-z]\b|\$(?!'+ident+')))' + ident_no_keyword, Name, ('#pop', 'bracket-check')), (r"'", String.Single, ('#pop', 'bracket-check', 'string-single')), (r'"', String.Double, ('#pop', 'bracket-check', 'string-double')), default(('#pop', 'block')), ], 'bracket-check': [ include('spaces'), (r':', Punctuation, ('#pop', 'object-sep', 'expr')), # is object default(('#pop', 'block', 'optional-semicolon', 'expr-chain')), # is block ], # code block 'block': [ include('spaces'), (r'\}', Punctuation, '#pop'), default('expr-statement'), ], # object in key-value pairs 'object': [ include('spaces'), (r'\}', Punctuation, '#pop'), default(('#pop', 'object-sep', 'expr', 'colon', 'ident-or-string')) ], # a key of an object 'ident-or-string': [ include('spaces'), (ident_no_keyword, Name, '#pop'), (r"'", String.Single, ('#pop', 'string-single')), (r'"', String.Double, ('#pop', 'string-double')), ], # after a key-value pair in object 'object-sep': [ include('spaces'), (r'\}', Punctuation, '#pop'), (r',', Punctuation, ('#pop', 'object')), ], } def analyse_text(text): if re.match(r'\w+\s*:\s*\w', text): return 0.3 class HxmlLexer(RegexLexer): """ Lexer for haXe build files. """ name = 'Hxml' url = 'https://haxe.org/manual/compiler-usage-hxml.html' aliases = ['haxeml', 'hxml'] filenames = ['*.hxml'] version_added = '1.6' tokens = { 'root': [ # Separator (r'(--)(next)', bygroups(Punctuation, Generic.Heading)), # Compiler switches with one dash (r'(-)(prompt|debug|v)', bygroups(Punctuation, Keyword.Keyword)), # Compilerswitches with two dashes (r'(--)(neko-source|flash-strict|flash-use-stage|no-opt|no-traces|' r'no-inline|times|no-output)', bygroups(Punctuation, Keyword)), # Targets and other options that take an argument (r'(-)(cpp|js|neko|x|as3|swf9?|swf-lib|php|xml|main|lib|D|resource|' r'cp|cmd)( +)(.+)', bygroups(Punctuation, Keyword, Whitespace, String)), # Options that take only numerical arguments (r'(-)(swf-version)( +)(\d+)', bygroups(Punctuation, Keyword, Whitespace, Number.Integer)), # An Option that defines the size, the fps and the background # color of an flash movie (r'(-)(swf-header)( +)(\d+)(:)(\d+)(:)(\d+)(:)([A-Fa-f0-9]{6})', bygroups(Punctuation, Keyword, Whitespace, Number.Integer, Punctuation, Number.Integer, Punctuation, Number.Integer, Punctuation, Number.Hex)), # options with two dashes that takes arguments (r'(--)(js-namespace|php-front|php-lib|remap|gen-hx-classes)( +)' r'(.+)', bygroups(Punctuation, Keyword, Whitespace, String)), # Single line comment, multiline ones are not allowed. (r'#.*', Comment.Single) ] }