Changeset 2294

Show
Ignore:
Timestamp:
11/29/07 14:18:49 (1 year ago)
Author:
hhubner
Message:

Updated version from http://joost.zeekat.nl/wp-content/javascript.el

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/trunk-reorg/thirdparty/emacs/javascript.el

    r2291 r2294  
    11;;; javascript.el --- Major mode for editing JavaScript source text 
     2 
     3;; This version contains a few font-lock fixes for quoted strings 
     4;; and regular expressions by Joost Diepenmaat <joost@zeekat.nl> 
     5;; Joost's version - 2007-11-29 
     6 
     7;; Currently known issues: 
     8;; 
     9;; /* .. */ style comments inside quoted strings are shown as comments 
     10;; instead of quoted strings. Fixing this may get complicated. 
    211 
    312;; Copyright (C) 2006 Karl Landström 
     
    817;; Date: 2006-12-26 
    918;; Keywords: languages, oop 
    10  
    11 ;; This version contains a few font-lock fixes for quoted strings 
    12 ;; and regular expressions by Joost Diepenmaat <joost@zeekat.nl> 
    1319 
    1420;; This file is free software; you can redistribute it and/or modify 
     
    118124    (modify-syntax-entry ?\" "." table) 
    119125 
     126    ;; partially disable comment detection. Our manual string detection  
     127    ;; won't work if there are automatically detected comments inside the  
     128    ;; string. 
     129    ;; 
     130    ;; note that we keep auto-detection of /* .. */ style comments since 
     131    ;; they are multi-line and can't easily be detected otherwise. 
     132    (modify-syntax-entry ?/ ". 14" table) 
     133 
    120134    ;; The syntax class of underscore should really be `symbol' ("_") 
    121135    ;; but that makes matching of tokens much more complex as e.g. 
     
    298312   ;; detect "autoquoted" object properties... clases with "switch { ...  default: }" 
    299313   ;; may not be worth the trouble 
    300    (list "\\(^[ \t]*\\|[,{][ \t]*\\)\\(\\w+\\):" 2 font-lock-string-face)) 
    301  
     314   (list "\\(^[ \t]*\\|[,{][ \t]*\\)\\(\\w+\\):" 2 font-lock-string-face) 
     315 
     316   ;; find single-line comments 
     317   (list "\\(//.*\\)" 1 font-lock-comment-face)) 
    302318  "Level one font lock.") 
    303319