Skip to content

Commit

Permalink
Merge Pascal comment style with OCaml's
Browse files Browse the repository at this point in the history
  • Loading branch information
rdipardo committed Mar 7, 2023
1 parent 4aa7edf commit ac1ddd3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions rplugin/pythonx/cpywrite/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ def _get_source_author():
('.p', '.pro'): 'Prolog'
},
('%%', '%% ')],
('.pas', '.pp', '.inc'):
[{('.pas', '.pp', '.inc'): 'Pascal'}, ('{', ' ', ' ', '}')],
('.c', '.cc', '.c++', '.cpp', '.cxx', '.cs', '.css', '.d', '.h', '.hh',
'.h++', '.hpp', '.hxx', '.java', '.js', '.jsx', '.mjs', '.kt', '.kts',
'.ktm', '.m', '.mm', '.php', '.php4', '.php5', '.phtml', '.re', '.rei',
Expand Down Expand Up @@ -396,8 +394,12 @@ def _get_source_author():
('/**', ' * ', ' *', ' */')],
('.elm'):
[{('.elm'): 'Elm'}, ('{-', ' ', ' ', '-}')],
('.ml', '.mli'):
[{('.ml', '.mli'): 'OCaml'}, ('(*', ' ', ' ', '*)')],
('.ml', '.mli', '.pas', '.pp', '.inc'):
[{
('.pas', '.pp', '.inc'): 'Pascal',
('.ml', '.mli'): 'OCaml'
},
('(*', ' ', ' ', '*)')],
('.html', '.htm', '.markdown', '.md', '.mkd', '.xml'):
[{('.html', '.htm'): 'HTML',
('.xml'): 'XML',
Expand Down
2 changes: 1 addition & 1 deletion rplugin/pythonx/test/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_language_recognition():

for src in pascal_files:
_, _, tokens = _get_language_meta(src)
assert tokens == ('{', ' ', ' ', '}')
assert tokens == ('(*', ' ', ' ', '*)')

for src in go_and_etc_files:
_, _, tokens = _get_language_meta(src)
Expand Down
2 changes: 1 addition & 1 deletion test/vader/pyx/test_new_langs.vader
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Then(Pascal file header quotes the entire X11 license);
AssertEqual ' Permission is hereby granted, free of charge, to any person obtaining a copy', getline(10)
AssertEqual ' Except as contained in this notice, the name of the X Consortium shall not', getline(27)
AssertEqual ' X Window System is a trademark of X Consortium, Inc.', getline(31)
AssertEqual 1, len(getline(32)), 'Allow no trailing spaces'
AssertEqual 2, len(getline(32)), 'Allow no trailing spaces'

Execute(Use :CPYwriteToggleMode to switch off verbatim mode);
call vader#log('===== Calling :CPYwriteToggleMode =====')
Expand Down

0 comments on commit ac1ddd3

Please sign in to comment.