maxima.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. /*
  2. Language: Maxima
  3. Author: Robert Dodier <robert.dodier@gmail.com>
  4. Website: http://maxima.sourceforge.net
  5. Category: scientific
  6. */
  7. function maxima(hljs) {
  8. const KEYWORDS =
  9. 'if then else elseif for thru do while unless step in and or not';
  10. const LITERALS =
  11. 'true false unknown inf minf ind und %e %i %pi %phi %gamma';
  12. const BUILTIN_FUNCTIONS =
  13. ' abasep abs absint absolute_real_time acos acosh acot acoth acsc acsch activate' +
  14. ' addcol add_edge add_edges addmatrices addrow add_vertex add_vertices adjacency_matrix' +
  15. ' adjoin adjoint af agd airy airy_ai airy_bi airy_dai airy_dbi algsys alg_type' +
  16. ' alias allroots alphacharp alphanumericp amortization %and annuity_fv' +
  17. ' annuity_pv antid antidiff AntiDifference append appendfile apply apply1 apply2' +
  18. ' applyb1 apropos args arit_amortization arithmetic arithsum array arrayapply' +
  19. ' arrayinfo arraymake arraysetapply ascii asec asech asin asinh askinteger' +
  20. ' asksign assoc assoc_legendre_p assoc_legendre_q assume assume_external_byte_order' +
  21. ' asympa at atan atan2 atanh atensimp atom atvalue augcoefmatrix augmented_lagrangian_method' +
  22. ' av average_degree backtrace bars barsplot barsplot_description base64 base64_decode' +
  23. ' bashindices batch batchload bc2 bdvac belln benefit_cost bern bernpoly bernstein_approx' +
  24. ' bernstein_expand bernstein_poly bessel bessel_i bessel_j bessel_k bessel_simplify' +
  25. ' bessel_y beta beta_incomplete beta_incomplete_generalized beta_incomplete_regularized' +
  26. ' bezout bfallroots bffac bf_find_root bf_fmin_cobyla bfhzeta bfloat bfloatp' +
  27. ' bfpsi bfpsi0 bfzeta biconnected_components bimetric binomial bipartition' +
  28. ' block blockmatrixp bode_gain bode_phase bothcoef box boxplot boxplot_description' +
  29. ' break bug_report build_info|10 buildq build_sample burn cabs canform canten' +
  30. ' cardinality carg cartan cartesian_product catch cauchy_matrix cbffac cdf_bernoulli' +
  31. ' cdf_beta cdf_binomial cdf_cauchy cdf_chi2 cdf_continuous_uniform cdf_discrete_uniform' +
  32. ' cdf_exp cdf_f cdf_gamma cdf_general_finite_discrete cdf_geometric cdf_gumbel' +
  33. ' cdf_hypergeometric cdf_laplace cdf_logistic cdf_lognormal cdf_negative_binomial' +
  34. ' cdf_noncentral_chi2 cdf_noncentral_student_t cdf_normal cdf_pareto cdf_poisson' +
  35. ' cdf_rank_sum cdf_rayleigh cdf_signed_rank cdf_student_t cdf_weibull cdisplay' +
  36. ' ceiling central_moment cequal cequalignore cf cfdisrep cfexpand cgeodesic' +
  37. ' cgreaterp cgreaterpignore changename changevar chaosgame charat charfun charfun2' +
  38. ' charlist charp charpoly chdir chebyshev_t chebyshev_u checkdiv check_overlaps' +
  39. ' chinese cholesky christof chromatic_index chromatic_number cint circulant_graph' +
  40. ' clear_edge_weight clear_rules clear_vertex_label clebsch_gordan clebsch_graph' +
  41. ' clessp clesspignore close closefile cmetric coeff coefmatrix cograd col collapse' +
  42. ' collectterms columnop columnspace columnswap columnvector combination combine' +
  43. ' comp2pui compare compfile compile compile_file complement_graph complete_bipartite_graph' +
  44. ' complete_graph complex_number_p components compose_functions concan concat' +
  45. ' conjugate conmetderiv connected_components connect_vertices cons constant' +
  46. ' constantp constituent constvalue cont2part content continuous_freq contortion' +
  47. ' contour_plot contract contract_edge contragrad contrib_ode convert coord' +
  48. ' copy copy_file copy_graph copylist copymatrix cor cos cosh cot coth cov cov1' +
  49. ' covdiff covect covers crc24sum create_graph create_list csc csch csetup cspline' +
  50. ' ctaylor ct_coordsys ctransform ctranspose cube_graph cuboctahedron_graph' +
  51. ' cunlisp cv cycle_digraph cycle_graph cylindrical days360 dblint deactivate' +
  52. ' declare declare_constvalue declare_dimensions declare_fundamental_dimensions' +
  53. ' declare_fundamental_units declare_qty declare_translated declare_unit_conversion' +
  54. ' declare_units declare_weights decsym defcon define define_alt_display define_variable' +
  55. ' defint defmatch defrule defstruct deftaylor degree_sequence del delete deleten' +
  56. ' delta demo demoivre denom depends derivdegree derivlist describe desolve' +
  57. ' determinant dfloat dgauss_a dgauss_b dgeev dgemm dgeqrf dgesv dgesvd diag' +
  58. ' diagmatrix diag_matrix diagmatrixp diameter diff digitcharp dimacs_export' +
  59. ' dimacs_import dimension dimensionless dimensions dimensions_as_list direct' +
  60. ' directory discrete_freq disjoin disjointp disolate disp dispcon dispform' +
  61. ' dispfun dispJordan display disprule dispterms distrib divide divisors divsum' +
  62. ' dkummer_m dkummer_u dlange dodecahedron_graph dotproduct dotsimp dpart' +
  63. ' draw draw2d draw3d drawdf draw_file draw_graph dscalar echelon edge_coloring' +
  64. ' edge_connectivity edges eigens_by_jacobi eigenvalues eigenvectors eighth' +
  65. ' einstein eivals eivects elapsed_real_time elapsed_run_time ele2comp ele2polynome' +
  66. ' ele2pui elem elementp elevation_grid elim elim_allbut eliminate eliminate_using' +
  67. ' ellipse elliptic_e elliptic_ec elliptic_eu elliptic_f elliptic_kc elliptic_pi' +
  68. ' ematrix empty_graph emptyp endcons entermatrix entertensor entier equal equalp' +
  69. ' equiv_classes erf erfc erf_generalized erfi errcatch error errormsg errors' +
  70. ' euler ev eval_string evenp every evolution evolution2d evundiff example exp' +
  71. ' expand expandwrt expandwrt_factored expint expintegral_chi expintegral_ci' +
  72. ' expintegral_e expintegral_e1 expintegral_ei expintegral_e_simplify expintegral_li' +
  73. ' expintegral_shi expintegral_si explicit explose exponentialize express expt' +
  74. ' exsec extdiff extract_linear_equations extremal_subset ezgcd %f f90 facsum' +
  75. ' factcomb factor factorfacsum factorial factorout factorsum facts fast_central_elements' +
  76. ' fast_linsolve fasttimes featurep fernfale fft fib fibtophi fifth filename_merge' +
  77. ' file_search file_type fillarray findde find_root find_root_abs find_root_error' +
  78. ' find_root_rel first fix flatten flength float floatnump floor flower_snark' +
  79. ' flush flush1deriv flushd flushnd flush_output fmin_cobyla forget fortran' +
  80. ' fourcos fourexpand fourier fourier_elim fourint fourintcos fourintsin foursimp' +
  81. ' foursin fourth fposition frame_bracket freeof freshline fresnel_c fresnel_s' +
  82. ' from_adjacency_matrix frucht_graph full_listify fullmap fullmapl fullratsimp' +
  83. ' fullratsubst fullsetify funcsolve fundamental_dimensions fundamental_units' +
  84. ' fundef funmake funp fv g0 g1 gamma gamma_greek gamma_incomplete gamma_incomplete_generalized' +
  85. ' gamma_incomplete_regularized gauss gauss_a gauss_b gaussprob gcd gcdex gcdivide' +
  86. ' gcfac gcfactor gd generalized_lambert_w genfact gen_laguerre genmatrix gensym' +
  87. ' geo_amortization geo_annuity_fv geo_annuity_pv geomap geometric geometric_mean' +
  88. ' geosum get getcurrentdirectory get_edge_weight getenv get_lu_factors get_output_stream_string' +
  89. ' get_pixel get_plot_option get_tex_environment get_tex_environment_default' +
  90. ' get_vertex_label gfactor gfactorsum ggf girth global_variances gn gnuplot_close' +
  91. ' gnuplot_replot gnuplot_reset gnuplot_restart gnuplot_start go Gosper GosperSum' +
  92. ' gr2d gr3d gradef gramschmidt graph6_decode graph6_encode graph6_export graph6_import' +
  93. ' graph_center graph_charpoly graph_eigenvalues graph_flow graph_order graph_periphery' +
  94. ' graph_product graph_size graph_union great_rhombicosidodecahedron_graph great_rhombicuboctahedron_graph' +
  95. ' grid_graph grind grobner_basis grotzch_graph hamilton_cycle hamilton_path' +
  96. ' hankel hankel_1 hankel_2 harmonic harmonic_mean hav heawood_graph hermite' +
  97. ' hessian hgfred hilbertmap hilbert_matrix hipow histogram histogram_description' +
  98. ' hodge horner hypergeometric i0 i1 %ibes ic1 ic2 ic_convert ichr1 ichr2 icosahedron_graph' +
  99. ' icosidodecahedron_graph icurvature ident identfor identity idiff idim idummy' +
  100. ' ieqn %if ifactors iframes ifs igcdex igeodesic_coords ilt image imagpart' +
  101. ' imetric implicit implicit_derivative implicit_plot indexed_tensor indices' +
  102. ' induced_subgraph inferencep inference_result infix info_display init_atensor' +
  103. ' init_ctensor in_neighbors innerproduct inpart inprod inrt integerp integer_partitions' +
  104. ' integrate intersect intersection intervalp intopois intosum invariant1 invariant2' +
  105. ' inverse_fft inverse_jacobi_cd inverse_jacobi_cn inverse_jacobi_cs inverse_jacobi_dc' +
  106. ' inverse_jacobi_dn inverse_jacobi_ds inverse_jacobi_nc inverse_jacobi_nd inverse_jacobi_ns' +
  107. ' inverse_jacobi_sc inverse_jacobi_sd inverse_jacobi_sn invert invert_by_adjoint' +
  108. ' invert_by_lu inv_mod irr is is_biconnected is_bipartite is_connected is_digraph' +
  109. ' is_edge_in_graph is_graph is_graph_or_digraph ishow is_isomorphic isolate' +
  110. ' isomorphism is_planar isqrt isreal_p is_sconnected is_tree is_vertex_in_graph' +
  111. ' items_inference %j j0 j1 jacobi jacobian jacobi_cd jacobi_cn jacobi_cs jacobi_dc' +
  112. ' jacobi_dn jacobi_ds jacobi_nc jacobi_nd jacobi_ns jacobi_p jacobi_sc jacobi_sd' +
  113. ' jacobi_sn JF jn join jordan julia julia_set julia_sin %k kdels kdelta kill' +
  114. ' killcontext kostka kron_delta kronecker_product kummer_m kummer_u kurtosis' +
  115. ' kurtosis_bernoulli kurtosis_beta kurtosis_binomial kurtosis_chi2 kurtosis_continuous_uniform' +
  116. ' kurtosis_discrete_uniform kurtosis_exp kurtosis_f kurtosis_gamma kurtosis_general_finite_discrete' +
  117. ' kurtosis_geometric kurtosis_gumbel kurtosis_hypergeometric kurtosis_laplace' +
  118. ' kurtosis_logistic kurtosis_lognormal kurtosis_negative_binomial kurtosis_noncentral_chi2' +
  119. ' kurtosis_noncentral_student_t kurtosis_normal kurtosis_pareto kurtosis_poisson' +
  120. ' kurtosis_rayleigh kurtosis_student_t kurtosis_weibull label labels lagrange' +
  121. ' laguerre lambda lambert_w laplace laplacian_matrix last lbfgs lc2kdt lcharp' +
  122. ' lc_l lcm lc_u ldefint ldisp ldisplay legendre_p legendre_q leinstein length' +
  123. ' let letrules letsimp levi_civita lfreeof lgtreillis lhs li liediff limit' +
  124. ' Lindstedt linear linearinterpol linear_program linear_regression line_graph' +
  125. ' linsolve listarray list_correlations listify list_matrix_entries list_nc_monomials' +
  126. ' listoftens listofvars listp lmax lmin load loadfile local locate_matrix_entry' +
  127. ' log logcontract log_gamma lopow lorentz_gauge lowercasep lpart lratsubst' +
  128. ' lreduce lriemann lsquares_estimates lsquares_estimates_approximate lsquares_estimates_exact' +
  129. ' lsquares_mse lsquares_residual_mse lsquares_residuals lsum ltreillis lu_backsub' +
  130. ' lucas lu_factor %m macroexpand macroexpand1 make_array makebox makefact makegamma' +
  131. ' make_graph make_level_picture makelist makeOrders make_poly_continent make_poly_country' +
  132. ' make_polygon make_random_state make_rgb_picture makeset make_string_input_stream' +
  133. ' make_string_output_stream make_transform mandelbrot mandelbrot_set map mapatom' +
  134. ' maplist matchdeclare matchfix mat_cond mat_fullunblocker mat_function mathml_display' +
  135. ' mat_norm matrix matrixmap matrixp matrix_size mattrace mat_trace mat_unblocker' +
  136. ' max max_clique max_degree max_flow maximize_lp max_independent_set max_matching' +
  137. ' maybe md5sum mean mean_bernoulli mean_beta mean_binomial mean_chi2 mean_continuous_uniform' +
  138. ' mean_deviation mean_discrete_uniform mean_exp mean_f mean_gamma mean_general_finite_discrete' +
  139. ' mean_geometric mean_gumbel mean_hypergeometric mean_laplace mean_logistic' +
  140. ' mean_lognormal mean_negative_binomial mean_noncentral_chi2 mean_noncentral_student_t' +
  141. ' mean_normal mean_pareto mean_poisson mean_rayleigh mean_student_t mean_weibull' +
  142. ' median median_deviation member mesh metricexpandall mgf1_sha1 min min_degree' +
  143. ' min_edge_cut minfactorial minimalPoly minimize_lp minimum_spanning_tree minor' +
  144. ' minpack_lsquares minpack_solve min_vertex_cover min_vertex_cut mkdir mnewton' +
  145. ' mod mode_declare mode_identity ModeMatrix moebius mon2schur mono monomial_dimensions' +
  146. ' multibernstein_poly multi_display_for_texinfo multi_elem multinomial multinomial_coeff' +
  147. ' multi_orbit multiplot_mode multi_pui multsym multthru mycielski_graph nary' +
  148. ' natural_unit nc_degree ncexpt ncharpoly negative_picture neighbors new newcontext' +
  149. ' newdet new_graph newline newton new_variable next_prime nicedummies niceindices' +
  150. ' ninth nofix nonarray noncentral_moment nonmetricity nonnegintegerp nonscalarp' +
  151. ' nonzeroandfreeof notequal nounify nptetrad npv nroots nterms ntermst' +
  152. ' nthroot nullity nullspace num numbered_boundaries numberp number_to_octets' +
  153. ' num_distinct_partitions numerval numfactor num_partitions nusum nzeta nzetai' +
  154. ' nzetar octets_to_number octets_to_oid odd_girth oddp ode2 ode_check odelin' +
  155. ' oid_to_octets op opena opena_binary openr openr_binary openw openw_binary' +
  156. ' operatorp opsubst optimize %or orbit orbits ordergreat ordergreatp orderless' +
  157. ' orderlessp orthogonal_complement orthopoly_recur orthopoly_weight outermap' +
  158. ' out_neighbors outofpois pade parabolic_cylinder_d parametric parametric_surface' +
  159. ' parg parGosper parse_string parse_timedate part part2cont partfrac partition' +
  160. ' partition_set partpol path_digraph path_graph pathname_directory pathname_name' +
  161. ' pathname_type pdf_bernoulli pdf_beta pdf_binomial pdf_cauchy pdf_chi2 pdf_continuous_uniform' +
  162. ' pdf_discrete_uniform pdf_exp pdf_f pdf_gamma pdf_general_finite_discrete' +
  163. ' pdf_geometric pdf_gumbel pdf_hypergeometric pdf_laplace pdf_logistic pdf_lognormal' +
  164. ' pdf_negative_binomial pdf_noncentral_chi2 pdf_noncentral_student_t pdf_normal' +
  165. ' pdf_pareto pdf_poisson pdf_rank_sum pdf_rayleigh pdf_signed_rank pdf_student_t' +
  166. ' pdf_weibull pearson_skewness permanent permut permutation permutations petersen_graph' +
  167. ' petrov pickapart picture_equalp picturep piechart piechart_description planar_embedding' +
  168. ' playback plog plot2d plot3d plotdf ploteq plsquares pochhammer points poisdiff' +
  169. ' poisexpt poisint poismap poisplus poissimp poissubst poistimes poistrim polar' +
  170. ' polarform polartorect polar_to_xy poly_add poly_buchberger poly_buchberger_criterion' +
  171. ' poly_colon_ideal poly_content polydecomp poly_depends_p poly_elimination_ideal' +
  172. ' poly_exact_divide poly_expand poly_expt poly_gcd polygon poly_grobner poly_grobner_equal' +
  173. ' poly_grobner_member poly_grobner_subsetp poly_ideal_intersection poly_ideal_polysaturation' +
  174. ' poly_ideal_polysaturation1 poly_ideal_saturation poly_ideal_saturation1 poly_lcm' +
  175. ' poly_minimization polymod poly_multiply polynome2ele polynomialp poly_normal_form' +
  176. ' poly_normalize poly_normalize_list poly_polysaturation_extension poly_primitive_part' +
  177. ' poly_pseudo_divide poly_reduced_grobner poly_reduction poly_saturation_extension' +
  178. ' poly_s_polynomial poly_subtract polytocompanion pop postfix potential power_mod' +
  179. ' powerseries powerset prefix prev_prime primep primes principal_components' +
  180. ' print printf printfile print_graph printpois printprops prodrac product properties' +
  181. ' propvars psi psubst ptriangularize pui pui2comp pui2ele pui2polynome pui_direct' +
  182. ' puireduc push put pv qput qrange qty quad_control quad_qag quad_qagi quad_qagp' +
  183. ' quad_qags quad_qawc quad_qawf quad_qawo quad_qaws quadrilateral quantile' +
  184. ' quantile_bernoulli quantile_beta quantile_binomial quantile_cauchy quantile_chi2' +
  185. ' quantile_continuous_uniform quantile_discrete_uniform quantile_exp quantile_f' +
  186. ' quantile_gamma quantile_general_finite_discrete quantile_geometric quantile_gumbel' +
  187. ' quantile_hypergeometric quantile_laplace quantile_logistic quantile_lognormal' +
  188. ' quantile_negative_binomial quantile_noncentral_chi2 quantile_noncentral_student_t' +
  189. ' quantile_normal quantile_pareto quantile_poisson quantile_rayleigh quantile_student_t' +
  190. ' quantile_weibull quartile_skewness quit qunit quotient racah_v racah_w radcan' +
  191. ' radius random random_bernoulli random_beta random_binomial random_bipartite_graph' +
  192. ' random_cauchy random_chi2 random_continuous_uniform random_digraph random_discrete_uniform' +
  193. ' random_exp random_f random_gamma random_general_finite_discrete random_geometric' +
  194. ' random_graph random_graph1 random_gumbel random_hypergeometric random_laplace' +
  195. ' random_logistic random_lognormal random_negative_binomial random_network' +
  196. ' random_noncentral_chi2 random_noncentral_student_t random_normal random_pareto' +
  197. ' random_permutation random_poisson random_rayleigh random_regular_graph random_student_t' +
  198. ' random_tournament random_tree random_weibull range rank rat ratcoef ratdenom' +
  199. ' ratdiff ratdisrep ratexpand ratinterpol rational rationalize ratnumer ratnump' +
  200. ' ratp ratsimp ratsubst ratvars ratweight read read_array read_binary_array' +
  201. ' read_binary_list read_binary_matrix readbyte readchar read_hashed_array readline' +
  202. ' read_list read_matrix read_nested_list readonly read_xpm real_imagpart_to_conjugate' +
  203. ' realpart realroots rearray rectangle rectform rectform_log_if_constant recttopolar' +
  204. ' rediff reduce_consts reduce_order region region_boundaries region_boundaries_plus' +
  205. ' rem remainder remarray rembox remcomps remcon remcoord remfun remfunction' +
  206. ' remlet remove remove_constvalue remove_dimensions remove_edge remove_fundamental_dimensions' +
  207. ' remove_fundamental_units remove_plot_option remove_vertex rempart remrule' +
  208. ' remsym remvalue rename rename_file reset reset_displays residue resolvante' +
  209. ' resolvante_alternee1 resolvante_bipartite resolvante_diedrale resolvante_klein' +
  210. ' resolvante_klein3 resolvante_produit_sym resolvante_unitaire resolvante_vierer' +
  211. ' rest resultant return reveal reverse revert revert2 rgb2level rhs ricci riemann' +
  212. ' rinvariant risch rk rmdir rncombine romberg room rootscontract round row' +
  213. ' rowop rowswap rreduce run_testsuite %s save saving scalarp scaled_bessel_i' +
  214. ' scaled_bessel_i0 scaled_bessel_i1 scalefactors scanmap scatterplot scatterplot_description' +
  215. ' scene schur2comp sconcat scopy scsimp scurvature sdowncase sec sech second' +
  216. ' sequal sequalignore set_alt_display setdifference set_draw_defaults set_edge_weight' +
  217. ' setelmx setequalp setify setp set_partitions set_plot_option set_prompt set_random_state' +
  218. ' set_tex_environment set_tex_environment_default setunits setup_autoload set_up_dot_simplifications' +
  219. ' set_vertex_label seventh sexplode sf sha1sum sha256sum shortest_path shortest_weighted_path' +
  220. ' show showcomps showratvars sierpinskiale sierpinskimap sign signum similaritytransform' +
  221. ' simp_inequality simplify_sum simplode simpmetderiv simtran sin sinh sinsert' +
  222. ' sinvertcase sixth skewness skewness_bernoulli skewness_beta skewness_binomial' +
  223. ' skewness_chi2 skewness_continuous_uniform skewness_discrete_uniform skewness_exp' +
  224. ' skewness_f skewness_gamma skewness_general_finite_discrete skewness_geometric' +
  225. ' skewness_gumbel skewness_hypergeometric skewness_laplace skewness_logistic' +
  226. ' skewness_lognormal skewness_negative_binomial skewness_noncentral_chi2 skewness_noncentral_student_t' +
  227. ' skewness_normal skewness_pareto skewness_poisson skewness_rayleigh skewness_student_t' +
  228. ' skewness_weibull slength smake small_rhombicosidodecahedron_graph small_rhombicuboctahedron_graph' +
  229. ' smax smin smismatch snowmap snub_cube_graph snub_dodecahedron_graph solve' +
  230. ' solve_rec solve_rec_rat some somrac sort sparse6_decode sparse6_encode sparse6_export' +
  231. ' sparse6_import specint spherical spherical_bessel_j spherical_bessel_y spherical_hankel1' +
  232. ' spherical_hankel2 spherical_harmonic spherical_to_xyz splice split sposition' +
  233. ' sprint sqfr sqrt sqrtdenest sremove sremovefirst sreverse ssearch ssort sstatus' +
  234. ' ssubst ssubstfirst staircase standardize standardize_inverse_trig starplot' +
  235. ' starplot_description status std std1 std_bernoulli std_beta std_binomial' +
  236. ' std_chi2 std_continuous_uniform std_discrete_uniform std_exp std_f std_gamma' +
  237. ' std_general_finite_discrete std_geometric std_gumbel std_hypergeometric std_laplace' +
  238. ' std_logistic std_lognormal std_negative_binomial std_noncentral_chi2 std_noncentral_student_t' +
  239. ' std_normal std_pareto std_poisson std_rayleigh std_student_t std_weibull' +
  240. ' stemplot stirling stirling1 stirling2 strim striml strimr string stringout' +
  241. ' stringp strong_components struve_h struve_l sublis sublist sublist_indices' +
  242. ' submatrix subsample subset subsetp subst substinpart subst_parallel substpart' +
  243. ' substring subvar subvarp sum sumcontract summand_to_rec supcase supcontext' +
  244. ' symbolp symmdifference symmetricp system take_channel take_inference tan' +
  245. ' tanh taylor taylorinfo taylorp taylor_simplifier taytorat tcl_output tcontract' +
  246. ' tellrat tellsimp tellsimpafter tentex tenth test_mean test_means_difference' +
  247. ' test_normality test_proportion test_proportions_difference test_rank_sum' +
  248. ' test_sign test_signed_rank test_variance test_variance_ratio tex tex1 tex_display' +
  249. ' texput %th third throw time timedate timer timer_info tldefint tlimit todd_coxeter' +
  250. ' toeplitz tokens to_lisp topological_sort to_poly to_poly_solve totaldisrep' +
  251. ' totalfourier totient tpartpol trace tracematrix trace_options transform_sample' +
  252. ' translate translate_file transpose treefale tree_reduce treillis treinat' +
  253. ' triangle triangularize trigexpand trigrat trigreduce trigsimp trunc truncate' +
  254. ' truncated_cube_graph truncated_dodecahedron_graph truncated_icosahedron_graph' +
  255. ' truncated_tetrahedron_graph tr_warnings_get tube tutte_graph ueivects uforget' +
  256. ' ultraspherical underlying_graph undiff union unique uniteigenvectors unitp' +
  257. ' units unit_step unitvector unorder unsum untellrat untimer' +
  258. ' untrace uppercasep uricci uriemann uvect vandermonde_matrix var var1 var_bernoulli' +
  259. ' var_beta var_binomial var_chi2 var_continuous_uniform var_discrete_uniform' +
  260. ' var_exp var_f var_gamma var_general_finite_discrete var_geometric var_gumbel' +
  261. ' var_hypergeometric var_laplace var_logistic var_lognormal var_negative_binomial' +
  262. ' var_noncentral_chi2 var_noncentral_student_t var_normal var_pareto var_poisson' +
  263. ' var_rayleigh var_student_t var_weibull vector vectorpotential vectorsimp' +
  264. ' verbify vers vertex_coloring vertex_connectivity vertex_degree vertex_distance' +
  265. ' vertex_eccentricity vertex_in_degree vertex_out_degree vertices vertices_to_cycle' +
  266. ' vertices_to_path %w weyl wheel_graph wiener_index wigner_3j wigner_6j' +
  267. ' wigner_9j with_stdout write_binary_data writebyte write_data writefile wronskian' +
  268. ' xreduce xthru %y Zeilberger zeroequiv zerofor zeromatrix zeromatrixp zeta' +
  269. ' zgeev zheev zlange zn_add_table zn_carmichael_lambda zn_characteristic_factors' +
  270. ' zn_determinant zn_factor_generators zn_invert_by_lu zn_log zn_mult_table' +
  271. ' absboxchar activecontexts adapt_depth additive adim aform algebraic' +
  272. ' algepsilon algexact aliases allbut all_dotsimp_denoms allocation allsym alphabetic' +
  273. ' animation antisymmetric arrays askexp assume_pos assume_pos_pred assumescalar' +
  274. ' asymbol atomgrad atrig1 axes axis_3d axis_bottom axis_left axis_right axis_top' +
  275. ' azimuth background background_color backsubst berlefact bernstein_explicit' +
  276. ' besselexpand beta_args_sum_to_integer beta_expand bftorat bftrunc bindtest' +
  277. ' border boundaries_array box boxchar breakup %c capping cauchysum cbrange' +
  278. ' cbtics center cflength cframe_flag cnonmet_flag color color_bar color_bar_tics' +
  279. ' colorbox columns commutative complex cone context contexts contour contour_levels' +
  280. ' cosnpiflag ctaypov ctaypt ctayswitch ctayvar ct_coords ctorsion_flag ctrgsimp' +
  281. ' cube current_let_rule_package cylinder data_file_name debugmode decreasing' +
  282. ' default_let_rule_package delay dependencies derivabbrev derivsubst detout' +
  283. ' diagmetric diff dim dimensions dispflag display2d|10 display_format_internal' +
  284. ' distribute_over doallmxops domain domxexpt domxmxops domxnctimes dontfactor' +
  285. ' doscmxops doscmxplus dot0nscsimp dot0simp dot1simp dotassoc dotconstrules' +
  286. ' dotdistrib dotexptsimp dotident dotscrules draw_graph_program draw_realpart' +
  287. ' edge_color edge_coloring edge_partition edge_type edge_width %edispflag' +
  288. ' elevation %emode endphi endtheta engineering_format_floats enhanced3d %enumer' +
  289. ' epsilon_lp erfflag erf_representation errormsg error_size error_syms error_type' +
  290. ' %e_to_numlog eval even evenfun evflag evfun ev_point expandwrt_denom expintexpand' +
  291. ' expintrep expon expop exptdispflag exptisolate exptsubst facexpand facsum_combine' +
  292. ' factlim factorflag factorial_expand factors_only fb feature features' +
  293. ' file_name file_output_append file_search_demo file_search_lisp file_search_maxima|10' +
  294. ' file_search_tests file_search_usage file_type_lisp file_type_maxima|10 fill_color' +
  295. ' fill_density filled_func fixed_vertices flipflag float2bf font font_size' +
  296. ' fortindent fortspaces fpprec fpprintprec functions gamma_expand gammalim' +
  297. ' gdet genindex gensumnum GGFCFMAX GGFINFINITY globalsolve gnuplot_command' +
  298. ' gnuplot_curve_styles gnuplot_curve_titles gnuplot_default_term_command gnuplot_dumb_term_command' +
  299. ' gnuplot_file_args gnuplot_file_name gnuplot_out_file gnuplot_pdf_term_command' +
  300. ' gnuplot_pm3d gnuplot_png_term_command gnuplot_postamble gnuplot_preamble' +
  301. ' gnuplot_ps_term_command gnuplot_svg_term_command gnuplot_term gnuplot_view_args' +
  302. ' Gosper_in_Zeilberger gradefs grid grid2d grind halfangles head_angle head_both' +
  303. ' head_length head_type height hypergeometric_representation %iargs ibase' +
  304. ' icc1 icc2 icounter idummyx ieqnprint ifb ifc1 ifc2 ifg ifgi ifr iframe_bracket_form' +
  305. ' ifri igeowedge_flag ikt1 ikt2 imaginary inchar increasing infeval' +
  306. ' infinity inflag infolists inm inmc1 inmc2 intanalysis integer integervalued' +
  307. ' integrate_use_rootsof integration_constant integration_constant_counter interpolate_color' +
  308. ' intfaclim ip_grid ip_grid_in irrational isolate_wrt_times iterations itr' +
  309. ' julia_parameter %k1 %k2 keepfloat key key_pos kinvariant kt label label_alignment' +
  310. ' label_orientation labels lassociative lbfgs_ncorrections lbfgs_nfeval_max' +
  311. ' leftjust legend letrat let_rule_packages lfg lg lhospitallim limsubst linear' +
  312. ' linear_solver linechar linel|10 linenum line_type linewidth line_width linsolve_params' +
  313. ' linsolvewarn lispdisp listarith listconstvars listdummyvars lmxchar load_pathname' +
  314. ' loadprint logabs logarc logcb logconcoeffp logexpand lognegint logsimp logx' +
  315. ' logx_secondary logy logy_secondary logz lriem m1pbranch macroexpansion macros' +
  316. ' mainvar manual_demo maperror mapprint matrix_element_add matrix_element_mult' +
  317. ' matrix_element_transpose maxapplydepth maxapplyheight maxima_tempdir|10 maxima_userdir|10' +
  318. ' maxnegex MAX_ORD maxposex maxpsifracdenom maxpsifracnum maxpsinegint maxpsiposint' +
  319. ' maxtayorder mesh_lines_color method mod_big_prime mode_check_errorp' +
  320. ' mode_checkp mode_check_warnp mod_test mod_threshold modular_linear_solver' +
  321. ' modulus multiplicative multiplicities myoptions nary negdistrib negsumdispflag' +
  322. ' newline newtonepsilon newtonmaxiter nextlayerfactor niceindicespref nm nmc' +
  323. ' noeval nolabels nonegative_lp noninteger nonscalar noun noundisp nouns np' +
  324. ' npi nticks ntrig numer numer_pbranch obase odd oddfun opacity opproperties' +
  325. ' opsubst optimprefix optionset orientation origin orthopoly_returns_intervals' +
  326. ' outative outchar packagefile palette partswitch pdf_file pfeformat phiresolution' +
  327. ' %piargs piece pivot_count_sx pivot_max_sx plot_format plot_options plot_realpart' +
  328. ' png_file pochhammer_max_index points pointsize point_size points_joined point_type' +
  329. ' poislim poisson poly_coefficient_ring poly_elimination_order polyfactor poly_grobner_algorithm' +
  330. ' poly_grobner_debug poly_monomial_order poly_primary_elimination_order poly_return_term_list' +
  331. ' poly_secondary_elimination_order poly_top_reduction_only posfun position' +
  332. ' powerdisp pred prederror primep_number_of_tests product_use_gamma program' +
  333. ' programmode promote_float_to_bigfloat prompt proportional_axes props psexpand' +
  334. ' ps_file radexpand radius radsubstflag rassociative ratalgdenom ratchristof' +
  335. ' ratdenomdivide rateinstein ratepsilon ratfac rational ratmx ratprint ratriemann' +
  336. ' ratsimpexpons ratvarswitch ratweights ratweyl ratwtlvl real realonly redraw' +
  337. ' refcheck resolution restart resultant ric riem rmxchar %rnum_list rombergabs' +
  338. ' rombergit rombergmin rombergtol rootsconmode rootsepsilon run_viewer same_xy' +
  339. ' same_xyz savedef savefactors scalar scalarmatrixp scale scale_lp setcheck' +
  340. ' setcheckbreak setval show_edge_color show_edges show_edge_type show_edge_width' +
  341. ' show_id show_label showtime show_vertex_color show_vertex_size show_vertex_type' +
  342. ' show_vertices show_weight simp simplified_output simplify_products simpproduct' +
  343. ' simpsum sinnpiflag solvedecomposes solveexplicit solvefactors solvenullwarn' +
  344. ' solveradcan solvetrigwarn space sparse sphere spring_embedding_depth sqrtdispflag' +
  345. ' stardisp startphi starttheta stats_numer stringdisp structures style sublis_apply_lambda' +
  346. ' subnumsimp sumexpand sumsplitfact surface surface_hide svg_file symmetric' +
  347. ' tab taylordepth taylor_logexpand taylor_order_coefficients taylor_truncate_polynomials' +
  348. ' tensorkill terminal testsuite_files thetaresolution timer_devalue title tlimswitch' +
  349. ' tr track transcompile transform transform_xy translate_fast_arrays transparent' +
  350. ' transrun tr_array_as_ref tr_bound_function_applyp tr_file_tty_messagesp tr_float_can_branch_complex' +
  351. ' tr_function_call_default trigexpandplus trigexpandtimes triginverses trigsign' +
  352. ' trivial_solutions tr_numer tr_optimize_max_loop tr_semicompile tr_state_vars' +
  353. ' tr_warn_bad_function_calls tr_warn_fexpr tr_warn_meval tr_warn_mode' +
  354. ' tr_warn_undeclared tr_warn_undefined_variable tstep ttyoff tube_extremes' +
  355. ' ufg ug %unitexpand unit_vectors uric uriem use_fast_arrays user_preamble' +
  356. ' usersetunits values vect_cross verbose vertex_color vertex_coloring vertex_partition' +
  357. ' vertex_size vertex_type view warnings weyl width windowname windowtitle wired_surface' +
  358. ' wireframe xaxis xaxis_color xaxis_secondary xaxis_type xaxis_width xlabel' +
  359. ' xlabel_secondary xlength xrange xrange_secondary xtics xtics_axis xtics_rotate' +
  360. ' xtics_rotate_secondary xtics_secondary xtics_secondary_axis xu_grid x_voxel' +
  361. ' xy_file xyplane xy_scale yaxis yaxis_color yaxis_secondary yaxis_type yaxis_width' +
  362. ' ylabel ylabel_secondary ylength yrange yrange_secondary ytics ytics_axis' +
  363. ' ytics_rotate ytics_rotate_secondary ytics_secondary ytics_secondary_axis' +
  364. ' yv_grid y_voxel yx_ratio zaxis zaxis_color zaxis_type zaxis_width zeroa zerob' +
  365. ' zerobern zeta%pi zlabel zlabel_rotate zlength zmin zn_primroot_limit zn_primroot_pretest';
  366. const SYMBOLS = '_ __ %|0 %%|0';
  367. return {
  368. name: 'Maxima',
  369. keywords: {
  370. $pattern: '[A-Za-z_%][0-9A-Za-z_%]*',
  371. keyword: KEYWORDS,
  372. literal: LITERALS,
  373. built_in: BUILTIN_FUNCTIONS,
  374. symbol: SYMBOLS
  375. },
  376. contains: [
  377. {
  378. className: 'comment',
  379. begin: '/\\*',
  380. end: '\\*/',
  381. contains: [ 'self' ]
  382. },
  383. hljs.QUOTE_STRING_MODE,
  384. {
  385. className: 'number',
  386. relevance: 0,
  387. variants: [
  388. {
  389. // float number w/ exponent
  390. // hmm, I wonder if we ought to include other exponent markers?
  391. begin: '\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Ee][-+]?\\d+\\b'
  392. },
  393. {
  394. // bigfloat number
  395. begin: '\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Bb][-+]?\\d+\\b',
  396. relevance: 10
  397. },
  398. {
  399. // float number w/out exponent
  400. // Doesn't seem to recognize floats which start with '.'
  401. begin: '\\b(\\.\\d+|\\d+\\.\\d+)\\b'
  402. },
  403. {
  404. // integer in base up to 36
  405. // Doesn't seem to recognize integers which end with '.'
  406. begin: '\\b(\\d+|0[0-9A-Za-z]+)\\.?\\b'
  407. }
  408. ]
  409. }
  410. ],
  411. illegal: /@/
  412. };
  413. }
  414. module.exports = maxima;