aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2013-05-16 20:36:33 -0400
committerStefan Monnier2013-05-16 20:36:33 -0400
commitf678b18a19e3c8050acfde90523b1542e4537053 (patch)
treec252c9da5a0603fbf6f677a907c1ef24173d0015 /lisp
parentc464dbc379fd84b0f05aaa1a0a6b261995daeb50 (diff)
downloademacs-f678b18a19e3c8050acfde90523b1542e4537053.tar.gz
emacs-f678b18a19e3c8050acfde90523b1542e4537053.zip
* lisp/progmodes/f90.el (f90-keywords-re, f90-keywords-level-3-re)
(f90-hpf-keywords-re, f90-constants-re): Use \\_< rather than regexp-opt's `words'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/f90.el200
2 files changed, 112 insertions, 94 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 84e1119bc64..78eefc86500 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-05-17 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/f90.el (f90-keywords-re, f90-keywords-level-3-re)
4 (f90-hpf-keywords-re, f90-constants-re): Use \\_< rather than
5 regexp-opt's `words'.
6
12013-05-16 Leo Liu <sdl.web@gmail.com> 72013-05-16 Leo Liu <sdl.web@gmail.com>
2 8
3 * emacs-lisp/smie.el (smie-matching-block-highlight): New face. 9 * emacs-lisp/smie.el (smie-matching-block-highlight): New face.
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index d7d0c109452..9bde2900a67 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -319,51 +319,57 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil."
319;; User options end here. 319;; User options end here.
320 320
321(defconst f90-keywords-re 321(defconst f90-keywords-re
322 (regexp-opt '("allocatable" "allocate" "assign" "assignment" "backspace" 322 (concat
323 "block" "call" "case" "character" "close" "common" "complex" 323 "\\_<"
324 "contains" "continue" "cycle" "data" "deallocate" 324 (regexp-opt '("allocatable" "allocate" "assign" "assignment" "backspace"
325 "dimension" "do" "double" "else" "elseif" "elsewhere" "end" 325 "block" "call" "case" "character" "close" "common" "complex"
326 "enddo" "endfile" "endif" "entry" "equivalence" "exit" 326 "contains" "continue" "cycle" "data" "deallocate"
327 "external" "forall" "format" "function" "goto" "if" 327 "dimension" "do" "double" "else" "elseif" "elsewhere" "end"
328 "implicit" "include" "inquire" "integer" "intent" 328 "enddo" "endfile" "endif" "entry" "equivalence" "exit"
329 "interface" "intrinsic" "logical" "module" "namelist" "none" 329 "external" "forall" "format" "function" "goto" "if"
330 "nullify" "only" "open" "operator" "optional" "parameter" 330 "implicit" "include" "inquire" "integer" "intent"
331 "pause" "pointer" "precision" "print" "private" "procedure" 331 "interface" "intrinsic" "logical" "module" "namelist" "none"
332 "program" "public" "read" "real" "recursive" "result" "return" 332 "nullify" "only" "open" "operator" "optional" "parameter"
333 "rewind" "save" "select" "sequence" "stop" "subroutine" 333 "pause" "pointer" "precision" "print" "private" "procedure"
334 "target" "then" "type" "use" "where" "while" "write" 334 "program" "public" "read" "real" "recursive" "result" "return"
335 ;; F95 keywords. 335 "rewind" "save" "select" "sequence" "stop" "subroutine"
336 "elemental" "pure" 336 "target" "then" "type" "use" "where" "while" "write"
337 ;; F2003 337 ;; F95 keywords.
338 "abstract" "associate" "asynchronous" "bind" "class" 338 "elemental" "pure"
339 "deferred" "enum" "enumerator" "extends" "extends_type_of" 339 ;; F2003
340 "final" "generic" "import" "non_intrinsic" "non_overridable" 340 "abstract" "associate" "asynchronous" "bind" "class"
341 "nopass" "pass" "protected" "same_type_as" "value" "volatile" 341 "deferred" "enum" "enumerator" "extends" "extends_type_of"
342 ;; F2008. 342 "final" "generic" "import" "non_intrinsic" "non_overridable"
343 "contiguous" "submodule" "concurrent" "codimension" 343 "nopass" "pass" "protected" "same_type_as" "value" "volatile"
344 "sync all" "sync memory" "critical" "image_index" 344 ;; F2008.
345 ) 'words) 345 "contiguous" "submodule" "concurrent" "codimension"
346 "sync all" "sync memory" "critical" "image_index"
347 ))
348 "\\_>")
346 "Regexp used by the function `f90-change-keywords'.") 349 "Regexp used by the function `f90-change-keywords'.")
347 350
348(defconst f90-keywords-level-3-re 351(defconst f90-keywords-level-3-re
349 (regexp-opt 352 (concat
350 '("allocatable" "allocate" "assign" "assignment" "backspace" 353 "\\_<"
351 "close" "deallocate" "dimension" "endfile" "entry" "equivalence" 354 (regexp-opt
352 "external" "inquire" "intent" "intrinsic" "nullify" "only" "open" 355 '("allocatable" "allocate" "assign" "assignment" "backspace"
353 ;; FIXME operator and assignment should be F2003 procedures? 356 "close" "deallocate" "dimension" "endfile" "entry" "equivalence"
354 "operator" "optional" "parameter" "pause" "pointer" "print" "private" 357 "external" "inquire" "intent" "intrinsic" "nullify" "only" "open"
355 "public" "read" "recursive" "result" "rewind" "save" "select" 358 ;; FIXME operator and assignment should be F2003 procedures?
356 "sequence" "target" "write" 359 "operator" "optional" "parameter" "pause" "pointer" "print" "private"
357 ;; F95 keywords. 360 "public" "read" "recursive" "result" "rewind" "save" "select"
358 "elemental" "pure" 361 "sequence" "target" "write"
359 ;; F2003. asynchronous separate. 362 ;; F95 keywords.
360 "abstract" "deferred" "import" "final" "non_intrinsic" "non_overridable" 363 "elemental" "pure"
361 "nopass" "pass" "protected" "value" "volatile" 364 ;; F2003. asynchronous separate.
362 ;; F2008. 365 "abstract" "deferred" "import" "final" "non_intrinsic" "non_overridable"
363 ;; "concurrent" is only in the sense of "do [,] concurrent", but given 366 "nopass" "pass" "protected" "value" "volatile"
364 ;; the [,] it's simpler to just do every instance (cf "do while"). 367 ;; F2008.
365 "contiguous" "concurrent" "codimension" "sync all" "sync memory" 368 ;; "concurrent" is only in the sense of "do [,] concurrent", but given
366 ) 'words) 369 ;; the [,] it's simpler to just do every instance (cf "do while").
370 "contiguous" "concurrent" "codimension" "sync all" "sync memory"
371 ))
372 "\\_>")
367 "Keyword-regexp for font-lock level >= 3.") 373 "Keyword-regexp for font-lock level >= 3.")
368 374
369(defconst f90-procedures-re 375(defconst f90-procedures-re
@@ -428,61 +434,67 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil."
428 "Regexp matching intrinsic operators.") 434 "Regexp matching intrinsic operators.")
429 435
430(defconst f90-hpf-keywords-re 436(defconst f90-hpf-keywords-re
431 (regexp-opt 437 (concat
432 ;; Intrinsic procedures. 438 "\\_<"
433 '("all_prefix" "all_scatter" "all_suffix" "any_prefix" 439 (regexp-opt
434 "any_scatter" "any_suffix" "copy_prefix" "copy_scatter" 440 ;; Intrinsic procedures.
435 "copy_suffix" "count_prefix" "count_scatter" "count_suffix" 441 '("all_prefix" "all_scatter" "all_suffix" "any_prefix"
436 "grade_down" "grade_up" 442 "any_scatter" "any_suffix" "copy_prefix" "copy_scatter"
437 "hpf_alignment" "hpf_distribution" "hpf_template" "iall" "iall_prefix" 443 "copy_suffix" "count_prefix" "count_scatter" "count_suffix"
438 "iall_scatter" "iall_suffix" "iany" "iany_prefix" "iany_scatter" 444 "grade_down" "grade_up"
439 "iany_suffix" "ilen" "iparity" "iparity_prefix" 445 "hpf_alignment" "hpf_distribution" "hpf_template" "iall" "iall_prefix"
440 "iparity_scatter" "iparity_suffix" "leadz" "maxval_prefix" 446 "iall_scatter" "iall_suffix" "iany" "iany_prefix" "iany_scatter"
441 "maxval_scatter" "maxval_suffix" "minval_prefix" "minval_scatter" 447 "iany_suffix" "ilen" "iparity" "iparity_prefix"
442 "minval_suffix" "number_of_processors" "parity" 448 "iparity_scatter" "iparity_suffix" "leadz" "maxval_prefix"
443 "parity_prefix" "parity_scatter" "parity_suffix" "popcnt" "poppar" 449 "maxval_scatter" "maxval_suffix" "minval_prefix" "minval_scatter"
444 "processors_shape" "product_prefix" "product_scatter" 450 "minval_suffix" "number_of_processors" "parity"
445 "product_suffix" "sum_prefix" "sum_scatter" "sum_suffix" 451 "parity_prefix" "parity_scatter" "parity_suffix" "popcnt" "poppar"
446 ;; Directives. 452 "processors_shape" "product_prefix" "product_scatter"
447 "align" "distribute" "dynamic" "independent" "inherit" "processors" 453 "product_suffix" "sum_prefix" "sum_scatter" "sum_suffix"
448 "realign" "redistribute" "template" 454 ;; Directives.
449 ;; Keywords. 455 "align" "distribute" "dynamic" "independent" "inherit" "processors"
450 "block" "cyclic" "extrinsic" "new" "onto" "pure" "with") 'words) 456 "realign" "redistribute" "template"
457 ;; Keywords.
458 "block" "cyclic" "extrinsic" "new" "onto" "pure" "with"))
459 "\\_>")
451 "Regexp for all HPF keywords, procedures and directives.") 460 "Regexp for all HPF keywords, procedures and directives.")
452 461
453(defconst f90-constants-re 462(defconst f90-constants-re
454 (regexp-opt '( ;; F2003 iso_fortran_env constants. 463 (concat
455 "iso_fortran_env" 464 "\\_<"
456 "input_unit" "output_unit" "error_unit" 465 (regexp-opt '( ;; F2003 iso_fortran_env constants.
457 "iostat_end" "iostat_eor" 466 "iso_fortran_env"
458 "numeric_storage_size" "character_storage_size" 467 "input_unit" "output_unit" "error_unit"
459 "file_storage_size" 468 "iostat_end" "iostat_eor"
460 ;; F2003 iso_c_binding constants. 469 "numeric_storage_size" "character_storage_size"
461 "iso_c_binding" 470 "file_storage_size"
462 "c_int" "c_short" "c_long" "c_long_long" "c_signed_char" 471 ;; F2003 iso_c_binding constants.
463 "c_size_t" 472 "iso_c_binding"
464 "c_int8_t" "c_int16_t" "c_int32_t" "c_int64_t" 473 "c_int" "c_short" "c_long" "c_long_long" "c_signed_char"
465 "c_int_least8_t" "c_int_least16_t" "c_int_least32_t" 474 "c_size_t"
466 "c_int_least64_t" 475 "c_int8_t" "c_int16_t" "c_int32_t" "c_int64_t"
467 "c_int_fast8_t" "c_int_fast16_t" "c_int_fast32_t" 476 "c_int_least8_t" "c_int_least16_t" "c_int_least32_t"
468 "c_int_fast64_t" 477 "c_int_least64_t"
469 "c_intmax_t" "c_intptr_t" 478 "c_int_fast8_t" "c_int_fast16_t" "c_int_fast32_t"
470 "c_float" "c_double" "c_long_double" 479 "c_int_fast64_t"
471 "c_float_complex" "c_double_complex" "c_long_double_complex" 480 "c_intmax_t" "c_intptr_t"
472 "c_bool" "c_char" 481 "c_float" "c_double" "c_long_double"
473 "c_null_char" "c_alert" "c_backspace" "c_form_feed" 482 "c_float_complex" "c_double_complex" "c_long_double_complex"
474 "c_new_line" "c_carriage_return" "c_horizontal_tab" 483 "c_bool" "c_char"
475 "c_vertical_tab" 484 "c_null_char" "c_alert" "c_backspace" "c_form_feed"
476 "c_ptr" "c_funptr" "c_null_ptr" "c_null_funptr" 485 "c_new_line" "c_carriage_return" "c_horizontal_tab"
477 "ieee_exceptions" 486 "c_vertical_tab"
478 "ieee_arithmetic" 487 "c_ptr" "c_funptr" "c_null_ptr" "c_null_funptr"
479 "ieee_features" 488 "ieee_exceptions"
480 ;; F2008 iso_fortran_env constants. 489 "ieee_arithmetic"
481 "character_kinds" "int8" "int16" "int32" "int64" 490 "ieee_features"
482 "integer_kinds" "iostat_inquire_internal_unit" 491 ;; F2008 iso_fortran_env constants.
483 "logical_kinds" "real_kinds" "real32" "real64" "real128" 492 "character_kinds" "int8" "int16" "int32" "int64"
484 "lock_type" "atomic_int_kind" "atomic_logical_kind" 493 "integer_kinds" "iostat_inquire_internal_unit"
485 ) 'words) 494 "logical_kinds" "real_kinds" "real32" "real64" "real128"
495 "lock_type" "atomic_int_kind" "atomic_logical_kind"
496 ))
497 "\\_>")
486 "Regexp for Fortran intrinsic constants.") 498 "Regexp for Fortran intrinsic constants.")
487 499
488;; cf f90-looking-at-type-like. 500;; cf f90-looking-at-type-like.