BasicPawn icon indicating copy to clipboard operation
BasicPawn copied to clipboard

Does not color numbers that has special symbols in it.

Open GAMMACASE opened this issue 6 years ago • 1 comments

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

GAMMACASE avatar Feb 08 '19 13:02 GAMMACASE

Already tried to add that years ago. The editor already supports hex by default because C/C++ syntax highlighting. Theres only one problem: Theres no config nor regex to change the behaviour, its hardcoded logic in the editor itself. Which means i have to edit the editor. Which i try to avoid for now (to fix BasicPawn related problems first). But i plan to edit the editors source in the future! Already found some Github versions. They are updated too.

TextEditor digit logic: https://github.com/gitextensions/ICSharpCode.TextEditor/blob/master/Project/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs#L495

Timocop avatar Feb 09 '19 00:02 Timocop