Bug 177098 - Function name that is treated as keyword in JavaFX is not properly formatted
Function name that is treated as keyword in JavaFX is not properly formatted
Status: VERIFIED FIXED
Product: javafx
Classification: Unclassified
Component: Editor
6.x
PC Windows XP
: P3 (vote)
: 6.x
Assigned To: Anton Chechel
issues@javafx
68patch1-verified
:
Depends on:
Blocks: 173487
  Show dependency treegraph
 
Reported: 2009-11-18 08:04 UTC by Alexandr Scherbatiy
Modified: 2010-01-26 02:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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(" ", " ");
}
-----------------------------------------

The result is:
-----------------------------------------
function r(str: String) {
    str. 
replace(" ", " ");
}
-----------------------------------------
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