diff options
author | CodingCellist <teh6@st-andrews.ac.uk> | 2020-09-05 21:37:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 21:37:11 +0200 |
commit | 3baafd5c336d18d87898ae87f16df7cd76bc8d65 (patch) | |
tree | 3bd6787bde3c5713fd5cfc7c962d60ac4b3dac50 /scripts | |
parent | b0124dc88082f5ed8c96faa16d3b334d38f5949f (diff) | |
download | vim-polyglot-3baafd5c336d18d87898ae87f16df7cd76bc8d65.tar.gz vim-polyglot-3baafd5c336d18d87898ae87f16df7cd76bc8d65.zip |
Add support for Idris2, closes #534 (#535)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build | 6 | ||||
-rw-r--r-- | scripts/test_extensions.vim | 30 | ||||
-rw-r--r-- | scripts/test_filetypes.vim | 2 |
3 files changed, 38 insertions, 0 deletions
diff --git a/scripts/build b/scripts/build index c7f4846f..79a1cfe7 100755 --- a/scripts/build +++ b/scripts/build @@ -77,6 +77,12 @@ def load_data() filetype["extensions"] ||= [] filetype["filenames"] ||= [] filetype["interpreters"] ||= [] + + filetype.keys.each do |key| + if key.start_with?("extra_") + raise "[#{filetype["name"]}]: #{key} is not allowed if linguist is not used" + end + end end end end diff --git a/scripts/test_extensions.vim b/scripts/test_extensions.vim index c45431d5..9211818d 100644 --- a/scripts/test_extensions.vim +++ b/scripts/test_extensions.vim @@ -190,6 +190,11 @@ call TestExtension('yaml.ansible', 'requirements.yaml', '') call TestExtension('ps1xml', 'foobar.ps1xml', '') call TestExtension('terraform', 'terraform.tf', '') +call TestExtension('idris2', 'foobar.idr', '') +call TestExtension('idris', 'foobar.idr', "pkgs : List String\npkgs = [\"NCurses\", \"Readline\"]") +let g:filetype_idr = 'fizfuz' +call TestExtension('fizfuz', 'fizfuz.idr', '') + " .m extension call TestExtension('octave', 'matlab.m', '') call TestExtension('objc', 'objc.m', "\n\n #import <Foundation/Foundation.h>") @@ -215,3 +220,28 @@ call TestExtension('cpp', 'cpp.re', '#include "config.h"') call TestExtension('cpp', 'cpp2.re', '#ifdef HAVE_CONFIG_H') call TestExtension('cpp', 'cpp3.re', '#define YYCTYPE unsigned char') call TestExtension('reason', 'react.re', 'ReasonReact.Router.push("");') + +" Idris +call TestExtension('idris', 'lowercase.idr', '--idris1') +call TestExtension('idris', 'uppercase.idr', '--Idris1') +call TestExtension('idris', 'start-space-l.idr', '-- idris1') +call TestExtension('idris', 'start-space-u.idr', '-- Idris1') +call TestExtension('idris', 'two-spaces-l.idr', '-- idris 1') +call TestExtension('idris', 'two-spaces-u.idr', '-- Idris 1') +"call TestExtension('idris', 'mypkg.ipkg', 'package mypkg\n\npkgs = pruviloj, lightyear') +call TestExtension('idris', 'use-type-prov.idr', '%language TypeProviders') +call TestExtension('idris', 'use-elab-refl.idr', '%language ElabReflection') +call TestExtension('idris', 'access-modifier.idr', '%access export\n\npublic export\nMyTest : Type-> Type\n\nfact : Nat -> Nat') +call TestExtension('idris2', 'lowercase.idr', '--idris2') +call TestExtension('idris2', 'uppercase.idr', '--Idris2') +call TestExtension('idris2', 'start-space-l.idr', '-- idris2') +call TestExtension('idris2', 'start-space-u.idr', '-- Idris2') +call TestExtension('idris2', 'two-spaces-l.idr', '-- idris 2') +call TestExtension('idris2', 'two-spaces-u.idr', '-- Idris 2') +call TestExtension('idris2', 'mypkg.ipkg', 'package mypkg\n\ndepends = effects') +call TestExtension('idris2', 'use-post-proj.idr', '%language PostfixProjections') + +" Literate Idris +call TestExtension('lidris', 'lidris-1.lidr', "Some test plaintext\n\n> --idris1\n> myfact : Nat -> Nat\n> myfact Z = 1\n> myfact (S k) = (S k) * myfact k\n\nMore plaintext") +call TestExtension('lidris2', 'lidris-2.lidr', "Some test plaintext\n\n> --idris2\n> myfact : Nat -> Nat\n> myfact Z = 1\n> myfact (S k) = (S k) * myfact k\n\nMore plaintext") + diff --git a/scripts/test_filetypes.vim b/scripts/test_filetypes.vim index d0bec4cc..0f870d5a 100644 --- a/scripts/test_filetypes.vim +++ b/scripts/test_filetypes.vim @@ -106,6 +106,8 @@ call TestFiletype('html') call TestFiletype('i3config') call TestFiletype('icalendar') call TestFiletype('idris') +call TestFiletype('idris2') +call TestFiletype('lidris2') call TestFiletype('ion') call TestFiletype('javascript') call TestFiletype('flow') |