Skip to content

Commit

Permalink
Initial partial load/translation of hljs 11.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed May 16, 2023
1 parent ab2cffa commit e68fe5e
Show file tree
Hide file tree
Showing 82 changed files with 2,713 additions and 2,851 deletions.
1,962 changes: 986 additions & 976 deletions demo/highlight.min.js

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/Highlight/languages/ada.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

function ada($hljs)
{
$INTEGER_RE = '\\d(_|\\d)*';
$EXPONENT_RE = '[eE][-+]?' + $INTEGER_RE;
$DECIMAL_LITERAL_RE = $INTEGER_RE + '(\\.' + $INTEGER_RE + ')?' + '(' + $EXPONENT_RE + ')?';
$BASED_INTEGER_RE = '\\w+';
$BASED_LITERAL_RE = $INTEGER_RE + '#' + $BASED_INTEGER_RE + '(\\.' + $BASED_INTEGER_RE + ')?' + '#' + '(' + $EXPONENT_RE + ')?';
$NUMBER_RE = '\\b(' + $BASED_LITERAL_RE + '|' + $DECIMAL_LITERAL_RE + ')';
$ID_REGEX = '[A-Za-z](_?[A-Za-z0-9.])*';
$BAD_CHARS = '[]\\{\\}%#\'"';
$COMMENTS = $hljs->COMMENT('--', '$');
$VAR_DECLS = (object) array('begin' => '\\s+:\\s+', 'end' => '\\s*(:=|;|\\)|=>|$)', 'illegal' => $BAD_CHARS, 'contains' => array((object) array('beginKeywords' => 'loop for declare others', 'endsParent' => true), (object) array('className' => 'keyword', 'beginKeywords' => 'not null constant access function procedure in out aliased exception'), (object) array('className' => 'type', 'begin' => $ID_REGEX, 'endsParent' => true, 'relevance' => 0)));
$KEYWORDS = array('abort', 'else', 'new', 'return', 'abs', 'elsif', 'not', 'reverse', 'abstract', 'end', 'accept', 'entry', 'select', 'access', 'exception', 'of', 'separate', 'aliased', 'exit', 'or', 'some', 'all', 'others', 'subtype', 'and', 'for', 'out', 'synchronized', 'array', 'function', 'overriding', 'at', 'tagged', 'generic', 'package', 'task', 'begin', 'goto', 'pragma', 'terminate', 'body', 'private', 'then', 'if', 'procedure', 'type', 'case', 'in', 'protected', 'constant', 'interface', 'is', 'raise', 'use', 'declare', 'range', 'delay', 'limited', 'record', 'when', 'delta', 'loop', 'rem', 'while', 'digits', 'renames', 'with', 'do', 'mod', 'requeue', 'xor');

return (object) array('name' => 'Ada', 'case_insensitive' => true, 'keywords' => (object) array('keyword' => $KEYWORDS, 'literal' => array('True', 'False')), 'contains' => array($COMMENTS, (object) array('className' => 'string', 'begin' => new Highlight\RegEx('/"/'), 'end' => new Highlight\RegEx('/"/'), 'contains' => array((object) array('begin' => new Highlight\RegEx('/""/'), 'relevance' => 0))), (object) array('className' => 'string', 'begin' => new Highlight\RegEx('/\'\\.\'/')), (object) array('className' => 'number', 'begin' => $NUMBER_RE, 'relevance' => 0), (object) array('className' => 'symbol', 'begin' => '\'' + $ID_REGEX), (object) array('className' => 'title', 'begin' => '(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?', 'end' => '(is|$)', 'keywords' => 'package body', 'excludeBegin' => true, 'excludeEnd' => true, 'illegal' => $BAD_CHARS), (object) array('begin' => '(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+', 'end' => '(\\bis|\\bwith|\\brenames|\\)\\s*;)', 'keywords' => 'overriding function procedure with is renames return', 'returnBegin' => true, 'contains' => array($COMMENTS, (object) array('className' => 'title', 'begin' => '(\\bwith\\s+)?\\b(function|procedure)\\s+', 'end' => '(\\(|\\s+|$)', 'excludeBegin' => true, 'excludeEnd' => true, 'illegal' => $BAD_CHARS), $VAR_DECLS, (object) array('className' => 'type', 'begin' => '\\breturn\\s+', 'end' => '(\\s+|;|$)', 'keywords' => 'return', 'excludeBegin' => true, 'excludeEnd' => true, 'endsParent' => true, 'illegal' => $BAD_CHARS))), (object) array('className' => 'type', 'begin' => '\\b(sub)?type\\s+', 'end' => '\\s+', 'keywords' => 'type', 'excludeBegin' => true, 'illegal' => $BAD_CHARS), $VAR_DECLS));
}
$module->exports = $ada;
7 changes: 7 additions & 0 deletions src/Highlight/languages/bnf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

function bnf($hljs)
{
return (object) array('name' => 'Backus–Naur Form', 'contains' => array((object) array('className' => 'attribute', 'begin' => new Highlight\RegEx('/\\</'), 'end' => new Highlight\RegEx('/\\>/')), (object) array('begin' => new Highlight\RegEx('/\\:\\:\\=/'), 'end' => new Highlight\RegEx('/\\$/'), 'contains' => array((object) array('begin' => new Highlight\RegEx('/\\</'), 'end' => new Highlight\RegEx('/\\>/')), $hljs->C_LINE_COMMENT_MODE, $hljs->C_BLOCK_COMMENT_MODE, $hljs->APOS_STRING_MODE, $hljs->QUOTE_STRING_MODE))));
}
$module->exports = $bnf;
7 changes: 7 additions & 0 deletions src/Highlight/languages/cmake.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

function cmake($hljs)
{
return (object) array('name' => 'CMake', 'aliases' => array('cmake.in'), 'case_insensitive' => true, 'keywords' => (object) array('keyword' => 'break cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro endwhile execute_process file find_file find_library find_package find_path find_program foreach function get_cmake_property get_directory_property get_filename_component get_property if include include_guard list macro mark_as_advanced math message option return separate_arguments set_directory_properties set_property set site_name string unset variable_watch while add_compile_definitions add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_link_options add_subdirectory add_test aux_source_directory build_command create_test_sourcelist define_property enable_language enable_testing export fltk_wrap_ui get_source_file_property get_target_property get_test_property include_directories include_external_msproject include_regular_expression install link_directories link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions set_source_files_properties set_target_properties set_tests_properties source_group target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_directories target_link_libraries target_link_options target_sources try_compile try_run ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload build_name exec_program export_library_dependencies install_files install_programs install_targets load_command make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or not command policy target test exists is_newer_than is_directory is_symlink is_absolute matches less greater equal less_equal greater_equal strless strgreater strequal strless_equal strgreater_equal version_less version_greater version_equal version_less_equal version_greater_equal in_list defined'), 'contains' => array((object) array('className' => 'variable', 'begin' => new Highlight\RegEx('/\\\\\\$\\\\\\{/'), 'end' => new Highlight\RegEx('/\\\\\\}/')), $hljs->COMMENT(new Highlight\RegEx('/\\#\\\\\\[\\\\\\[/'), new Highlight\RegEx('/\\]\\]/')), $hljs->HASH_COMMENT_MODE, $hljs->QUOTE_STRING_MODE, $hljs->NUMBER_MODE));
}
$module->exports = $cmake;
10 changes: 10 additions & 0 deletions src/Highlight/languages/coq.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

function coq($hljs)
{
$KEYWORDS = array('_|0', 'as', 'at', 'cofix', 'else', 'end', 'exists', 'exists2', 'fix', 'for', 'forall', 'fun', 'if', 'IF', 'in', 'let', 'match', 'mod', 'Prop', 'return', 'Set', 'then', 'Type', 'using', 'where', 'with', 'Abort', 'About', 'Add', 'Admit', 'Admitted', 'All', 'Arguments', 'Assumptions', 'Axiom', 'Back', 'BackTo', 'Backtrack', 'Bind', 'Blacklist', 'Canonical', 'Cd', 'Check', 'Class', 'Classes', 'Close', 'Coercion', 'Coercions', 'CoFixpoint', 'CoInductive', 'Collection', 'Combined', 'Compute', 'Conjecture', 'Conjectures', 'Constant', 'constr', 'Constraint', 'Constructors', 'Context', 'Corollary', 'CreateHintDb', 'Cut', 'Declare', 'Defined', 'Definition', 'Delimit', 'Dependencies', 'Dependent', 'Derive', 'Drop', 'eauto', 'End', 'Equality', 'Eval', 'Example', 'Existential', 'Existentials', 'Existing', 'Export', 'exporting', 'Extern', 'Extract', 'Extraction', 'Fact', 'Field', 'Fields', 'File', 'Fixpoint', 'Focus', 'for', 'From', 'Function', 'Functional', 'Generalizable', 'Global', 'Goal', 'Grab', 'Grammar', 'Graph', 'Guarded', 'Heap', 'Hint', 'HintDb', 'Hints', 'Hypotheses', 'Hypothesis', 'ident', 'Identity', 'If', 'Immediate', 'Implicit', 'Import', 'Include', 'Inductive', 'Infix', 'Info', 'Initial', 'Inline', 'Inspect', 'Instance', 'Instances', 'Intro', 'Intros', 'Inversion', 'Inversion_clear', 'Language', 'Left', 'Lemma', 'Let', 'Libraries', 'Library', 'Load', 'LoadPath', 'Local', 'Locate', 'Ltac', 'ML', 'Mode', 'Module', 'Modules', 'Monomorphic', 'Morphism', 'Next', 'NoInline', 'Notation', 'Obligation', 'Obligations', 'Opaque', 'Open', 'Optimize', 'Options', 'Parameter', 'Parameters', 'Parametric', 'Path', 'Paths', 'pattern', 'Polymorphic', 'Preterm', 'Print', 'Printing', 'Program', 'Projections', 'Proof', 'Proposition', 'Pwd', 'Qed', 'Quit', 'Rec', 'Record', 'Recursive', 'Redirect', 'Relation', 'Remark', 'Remove', 'Require', 'Reserved', 'Reset', 'Resolve', 'Restart', 'Rewrite', 'Right', 'Ring', 'Rings', 'Save', 'Scheme', 'Scope', 'Scopes', 'Script', 'Search', 'SearchAbout', 'SearchHead', 'SearchPattern', 'SearchRewrite', 'Section', 'Separate', 'Set', 'Setoid', 'Show', 'Solve', 'Sorted', 'Step', 'Strategies', 'Strategy', 'Structure', 'SubClass', 'Table', 'Tables', 'Tactic', 'Term', 'Test', 'Theorem', 'Time', 'Timeout', 'Transparent', 'Type', 'Typeclasses', 'Types', 'Undelimit', 'Undo', 'Unfocus', 'Unfocused', 'Unfold', 'Universe', 'Universes', 'Unset', 'Unshelve', 'using', 'Variable', 'Variables', 'Variant', 'Verbose', 'Visibility', 'where', 'with');
$BUILT_INS = array('abstract', 'absurd', 'admit', 'after', 'apply', 'as', 'assert', 'assumption', 'at', 'auto', 'autorewrite', 'autounfold', 'before', 'bottom', 'btauto', 'by', 'case', 'case_eq', 'cbn', 'cbv', 'change', 'classical_left', 'classical_right', 'clear', 'clearbody', 'cofix', 'compare', 'compute', 'congruence', 'constr_eq', 'constructor', 'contradict', 'contradiction', 'cut', 'cutrewrite', 'cycle', 'decide', 'decompose', 'dependent', 'destruct', 'destruction', 'dintuition', 'discriminate', 'discrR', 'do', 'double', 'dtauto', 'eapply', 'eassumption', 'eauto', 'ecase', 'econstructor', 'edestruct', 'ediscriminate', 'eelim', 'eexact', 'eexists', 'einduction', 'einjection', 'eleft', 'elim', 'elimtype', 'enough', 'equality', 'erewrite', 'eright', 'esimplify_eq', 'esplit', 'evar', 'exact', 'exactly_once', 'exfalso', 'exists', 'f_equal', 'fail', 'field', 'field_simplify', 'field_simplify_eq', 'first', 'firstorder', 'fix', 'fold', 'fourier', 'functional', 'generalize', 'generalizing', 'gfail', 'give_up', 'has_evar', 'hnf', 'idtac', 'in', 'induction', 'injection', 'instantiate', 'intro', 'intro_pattern', 'intros', 'intuition', 'inversion', 'inversion_clear', 'is_evar', 'is_var', 'lapply', 'lazy', 'left', 'lia', 'lra', 'move', 'native_compute', 'nia', 'nsatz', 'omega', 'once', 'pattern', 'pose', 'progress', 'proof', 'psatz', 'quote', 'record', 'red', 'refine', 'reflexivity', 'remember', 'rename', 'repeat', 'replace', 'revert', 'revgoals', 'rewrite', 'rewrite_strat', 'right', 'ring', 'ring_simplify', 'rtauto', 'set', 'setoid_reflexivity', 'setoid_replace', 'setoid_rewrite', 'setoid_symmetry', 'setoid_transitivity', 'shelve', 'shelve_unifiable', 'simpl', 'simple', 'simplify_eq', 'solve', 'specialize', 'split', 'split_Rabs', 'split_Rmult', 'stepl', 'stepr', 'subst', 'sum', 'swap', 'symmetry', 'tactic', 'tauto', 'time', 'timeout', 'top', 'transitivity', 'trivial', 'try', 'tryif', 'unfold', 'unify', 'until', 'using', 'vm_compute', 'with');

return (object) array('name' => 'Coq', 'keywords' => (object) array('keyword' => $KEYWORDS, 'built_in' => $BUILT_INS), 'contains' => array($hljs->QUOTE_STRING_MODE, $hljs->COMMENT('\\(\\*', '\\*\\)'), $hljs->C_NUMBER_MODE, (object) array('className' => 'type', 'excludeBegin' => true, 'begin' => '\\|\\s*', 'end' => '\\w+'), (object) array('begin' => new Highlight\RegEx('/\\[\\-\\=\\]\\>/'))));
}
$module->exports = $coq;

0 comments on commit e68fe5e

Please sign in to comment.