Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remaining syntax highlighting test files #1668

Merged
merged 20 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
## Other

- Fix Clippy lints, see #1661 (@mohamed-abdelnour)
- Add syntax highlighting test files, see #1213 and #1668 (@mohamed-abdelnour)


## Syntaxes
Expand Down
1 change: 1 addition & 0 deletions tests/syntax-tests/create_highlighted_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

SKIP_FILENAMES = [
"LICENSE.md",
"NOTICE",
"README.md",
"bat_options",
]
Expand Down
247 changes: 247 additions & 0 deletions tests/syntax-tests/highlighted/Cabal/semantic.cabal

Large diffs are not rendered by default.

391 changes: 391 additions & 0 deletions tests/syntax-tests/highlighted/CoffeeScript/coffeescript.coffee

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions tests/syntax-tests/highlighted/F#/string.fs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions tests/syntax-tests/highlighted/Fortran (Modern)/test_savetxt.f90

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions tests/syntax-tests/highlighted/Fortran Namelist/test.namelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
&TEST
FOO=0,
BAR=1.0,
BAZ='Hello, World!'
/

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions tests/syntax-tests/highlighted/Literate Haskell/Main.lhs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
\documentclass{article}

\begin{document}

\section*{Introduction}

Text outside code environments should follow TeX/LaTeX highlighting.

The code environment delimiters themselves should be highlighted.

Text inside code environments should follow regular Haskell highlighting.

\begin{code}
import Data.List
import System.Environment
import Text.Printf

twoSumN :: Int -> [Int] -> [Int]
twoSumN _ [] = []
twoSumN n (x : xs) | (n - x) `elem` xs = [x, n - x]
 | otherwise = twoSumN n xs

threeSumN :: Int -> [Int] -> [Int]
threeSumN _ [] = []
threeSumN n (x : xs) | null partial = threeSumN n xs
 | otherwise = x : partial
 where partial = twoSumN (n - x) xs
\end{code}

Text in-between code environments.
% LaTeX comment.

\begin{code}
output :: String -> IO ()
output path = do
 input <- sort . map read . filter (not . null) . lines <$> readFile path
 printf "File: %s\n" path
 printf " Part 1: %d\n" . product . twoSumN 2020 $ input
 printf " Part 2: %d\n" . product . threeSumN 2020 $ input

-- Haskell comment inside code environment.

main :: IO ()
main = getArgs >>= mapM_ output
\end{code}

\end{document}
Loading