Bug 177098

Summary: Function name that is treated as keyword in JavaFX is not properly formatted
Product: javafx Reporter: Alexandr Scherbatiy <sunflower>
Component: EditorAssignee: Anton Chechel <manowar>
Status: VERIFIED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P3 CC: sustaining
Version: 6.x   
Target Milestone: 6.x   
Hardware: PC   
OS: Windows XP   
Whiteboard: 68patch1-verified
Issue Type: DEFECT Exception Report:
Bug Depends on:    
Bug Blocks: 173487    

Description Alexandr Scherbatiy 2009-11-18 08:04:09 UTC
Product Version         = NetBeans IDE Dev (Build 200911171401) (#d7b3ad6247f5)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02; Sun
Microsystems Inc.


Steps to reproduce:
- Format the code
-----------------------------------------
function r(str:String) {
    str.replace(" ", "&nbsp;");
}
-----------------------------------------

The result is:
-----------------------------------------
function r(str: String) {
    str. 
replace(" ", "&nbsp;");
}
-----------------------------------------
Comment 1 Anton Chechel 2009-11-26 07:06:40 UTC
fixed
http://hg.netbeans.org/javafx/rev/0a46ffba496b

By the way this is very interesting bug. Unlike Java in JavaFX there are non-reserved keywords like "replace" which can be identifiers as well.

Please create issue for semantic highlighting: all non-reserved keywords which are identifiers incorrectly highlighted.

===
// ---------------------
// Non-reserved keywords
//
// Some tokens are returned by the lexer as keywords for the grammar
// but are not reserved words in the language. These can be used as
// identifiers and are basically the set of keywords that cannot
// possibly start a statement/expression, such as 'to' but not those
// that are not sensible to allow as identifiers, such as 'true'.
//
keyword
    : FIRST     | IN    | INIT      | INTO
    | INVERSE   | LAST  | ON        | POSTINIT      
    | REPLACE   | STEP  | TRIGGER   | TWEEN
    | WHERE     | WITH  | INVALIDATE
    ;
===
openjfx-compiler~soma-master\src\share\classes\com\sun\tools\javafx\antlr\v4Parser.g
Comment 2 Alexandr Scherbatiy 2009-11-27 03:12:54 UTC
Created issue 177721  Function name that is treated as keyword in JavaFX is not properly highlighted
Comment 3 Alexandr Scherbatiy 2009-12-11 04:58:10 UTC
verified in NetBeans-JavaFX-Soma:  #62
Comment 4 Petr Suchomel 2010-01-15 03:32:57 UTC
Fixed in release68_fixes
http://hg.netbeans.org/javafx/rev/750b7c473828
Comment 5 Alexandr Scherbatiy 2010-01-26 02:53:41 UTC
Verified in NB 6.8 patch1 2010-01-25_21-27-59
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo