Skip to content

Commit

Permalink
Add Cython support
Browse files Browse the repository at this point in the history
Cython / Pyrex files can show as .pyx | .pxi | .pxd and share most of the
Python syntax.

Issue #99
  • Loading branch information
naufraghi committed Oct 18, 2018
1 parent 485b764 commit 3604026
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub enum Lang {
Css,
CUDA,
CUDAHeader,
Cython,
D,
Dart,
DeviceTree,
Expand Down Expand Up @@ -184,6 +185,7 @@ impl Lang {
Css => "CSS",
CUDA => "CUDA",
CUDAHeader => "CUDA Header",
Cython => "Cython",
D => "D",
Dart => "Dart",
DeviceTree => "DeviceTree",
Expand Down Expand Up @@ -398,6 +400,7 @@ pub fn lang_from_ext(filepath: &str) -> Lang {
"purs" => PureScript,
"arr" => Pyret,
"py" => Python,
"pxi" | "pxd" | "pyx" => Cython,
"r" => R,
"rake" | "rb" => Ruby,
"rhtml" | "erb" => RubyHtml,
Expand Down Expand Up @@ -468,9 +471,9 @@ pub fn counter_config_for_lang<'a>(lang: Lang) -> (SmallVec<[&'a str; 3]>, Small
Perl => (smallvec!["#"], smallvec![("=pod", "=cut")]),
Puppet => (smallvec!["#"], smallvec![]),
Pyret => (smallvec!["#"], smallvec![("#|", "|#")]),
Python => (smallvec!["#"], smallvec![("'''", "'''")]),
Ruby => (smallvec!["#"], smallvec![("=begin", "=end")]),
Sql => (smallvec!["--"], smallvec![("/*", "*/")]),
Python | Cython => (smallvec!["#"], smallvec![("'''", "'''")]),

Haskell | Idris | Agda | PureScript | Elm => (smallvec!["--"], smallvec![("{-", "-}")]),

Expand Down

0 comments on commit 3604026

Please sign in to comment.