Skip to content

Does not color numbers that has special symbols in it. #49

Open
@GAMMACASE

Description

@GAMMACASE

You can use _ in almost any number in sp (except after decimal point in floats), also there's octal and binary representation of a value you can use, here how it looks like:
image
As I've been told, _ symbol used just for readability, and it actually does nothing. o stands for octal, and b stands for binary and I see that you already included hex values and exponents for floats.
Also here that code in raw text (if you want to test it yourself):

	int testi = 1_000_000;
	testi = 0b010_1;
	testi = 0x0_0001;
	testi = 0o_040_01;
	float testf = 2.0___20e3;

Also here you can look yourself what symbols are used and how compiler interprets values as normal:
for binary: https://github.com/alliedmodders/sourcepawn/blob/7915dde93cab5f9ce0d2318e3e4578db3a712ab6/compiler/lexer.cpp#L510-L530
for octal: https://github.com/alliedmodders/sourcepawn/blob/7915dde93cab5f9ce0d2318e3e4578db3a712ab6/compiler/lexer.cpp#L540-L564
for normal decimal: https://github.com/alliedmodders/sourcepawn/blob/7915dde93cab5f9ce0d2318e3e4578db3a712ab6/compiler/lexer.cpp#L572-L590
for hex: https://github.com/alliedmodders/sourcepawn/blob/7915dde93cab5f9ce0d2318e3e4578db3a712ab6/compiler/lexer.cpp#L598-L626
and float: https://github.com/alliedmodders/sourcepawn/blob/7915dde93cab5f9ce0d2318e3e4578db3a712ab6/compiler/lexer.cpp#L643-L756

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions