Bug 386391 - Kate: code highlighting java: Binary Literals not supported
Summary: Kate: code highlighting java: Binary Literals not supported
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-31 15:59 UTC by hoea
Modified: 2018-08-13 02:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hoea 2017-10-31 15:59:29 UTC
Java has Binary Literals (https://docs.oracle.com/javase/8/docs/technotes/guides/language/binary-literals.html), but the highlighting doesn't work)

Example:
int x = 0b0110000;
Comment 1 Nibaldo G. 2018-08-13 02:39:27 UTC
Git commit 48c8c7acd4768342ba79c5b1feeda06f0f803281 by Nibaldo González.
Committed on 13/08/2018 at 02:39.
Pushed by ngonzalez into branch 'master'.

Java: add binaries & hex-float, and support underscores in numbers

Summary:
Some improvements in the highlighting of literal numbers:

* Add binaries: `0b1010` [1][3].

* Allow underscores in numbers (Float, Int, Hex, Octal & Binary) [2][3][4].

NOTE: The exact format of the numbers supported can be found in ref. [3] & [4].

* Add hexadecimal floating point: `0xA21.F18p+123` [4].

* Add missing suffixes in numbers: "L" in Hex & Octal, and "D" in Float [3][4].

**References:**
* [1] Java (8) Documentation. Binary Literals: https://docs.oracle.com/javase/8/docs/technotes/guides/language/binary-literals.html
* [2] Java (8) Documentation. Underscores in Numeric Literals: https://docs.oracle.com/javase/8/docs/technotes/guides/language/underscores-literals.html
* [3] Java Language Specification. Chapter 3, Lexical Structure. [3.10.1] Integer Literals: https://docs.oracle.com/javase/specs/jls/se10/html/jls-3.html#jls-3.10.1
* [4] Java Language Specification. Chapter 3, Lexical Structure. [3.10.2] Floating-Point Literals: https://docs.oracle.com/javase/specs/jls/se10/html/jls-3.html#jls-3.10.2

Reviewers: dhaumann, cullmann, vkrause, #kate

Reviewed By: cullmann, #kate

Subscribers: ngraham, kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D14702

M  +9    -0    autotests/folding/highlight.java.fold
M  +9    -0    autotests/html/highlight.java.html
M  +9    -0    autotests/input/highlight.java
M  +9    -0    autotests/reference/highlight.java.ref
M  +14   -10   data/syntax/java.xml

https://commits.kde.org/syntax-highlighting/48c8c7acd4768342ba79c5b1feeda06f0f803281