Skip to content

Commit 0c67b2e

Browse files
author
Alex Cole
committed
Pawno-compatible headers.
1 parent a1e4702 commit 0c67b2e

14 files changed

+150
-39
lines changed

documentation/design-document.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,19 @@ native NotDeclared();
9393
*/
9494
```
9595

96-
Pawno just uses almost any line that starts with `native`; Qawno is a little stricter - the line must be vaguely valid syntax, but interprets any native name that starts with `#` as a subheading in the list. We can semi-replicate these headings in Pawno as well by using invalid lines for spacing:
96+
Pawno just uses almost any line that starts with `native`; Qawno is a little stricter - the line must be vaguely valid syntax, but interprets any native name that starts with `#` as a subheading in the list. We can semi-replicate these headings in Pawno using some clever tricks to confuse both editors in different ways - Pawno to pad the headings, and Qawno to hide things we don't want. The code below has a number of `.`s in it, so that you can see what is happening, but you should know that each of those `.`s are in fact ASCII character `0xA0`, which renders as a space without causing the lines to be entirely elided:
9797

9898
```pawn
9999
/*
100-
native
101-
native #Heading();
100+
native # Heading();
101+
native ............Heading(
102+
native .....====================(
102103
native
103104
*/
104105
```
105106

107+
The `#` causes Qawno to render its native heading, while the other lines are all sufficiently invalid that it will entirely ignore them. Pawno will render all four, but the first and last are sufficiently invalid to it that they will both be blank, while the other two contain padding characters for alignment.
108+
106109
## `__` prefix.
107110

108111
It has always been the case that the `__` prefix on symbols is reserved for the compiler and system libraries; well, these are the system libraries, so they use them. This is to try and avoid any potential conflicts with user code - if all variables in these includes start with `__` and none in user code do there can't be any conflicts!

omp_checkpoint.inc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ static stock CP_TYPE:_@CP_TYPE() { return __CP_TYPE; }
7272
*/
7373

7474
/*
75-
native #Player Checkpoints();
75+
native # Player Checkpoints();
76+
native       Player Checkpoints(
77+
native      ====================(
78+
native
7679
*/
7780

7881
/**
@@ -195,7 +198,10 @@ native bool:GetPlayerCheckpoint(playerid, &Float:centreX = 0.0, &Float:centreY =
195198
*/
196199

197200
/*
198-
native #Race Checkpoints();
201+
native # Race Checkpoints();
202+
native        Race Checkpoints(
203+
native      ====================(
204+
native
199205
*/
200206

201207
/**

omp_core.inc

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,10 @@ static stock PLAYER_MARKERS_MODE:_@PLAYER_MARKERS_MODE() { return __PLAYER_MARKE
255255
256256
*/
257257
/*
258-
native #Pawn Utilities();
258+
native # Pawn Utilities();
259+
native         Pawn Utilities(
260+
native      ====================(
261+
native
259262
*/
260263

261264
/**
@@ -707,7 +710,10 @@ native void:CreateExplosion(Float:x, Float:y, Float:z, type, Float:radius);
707710
*/
708711

709712
/*
710-
native #Maths();
713+
native # Maths();
714+
native             Maths(
715+
native      ====================(
716+
native
711717
*/
712718

713719
/**
@@ -817,7 +823,10 @@ native Float:ATan2(Float:y, Float:x) = atan2;
817823
*/
818824

819825
/*
820-
native #Server Config();
826+
native # Server Config();
827+
native         Server Config(
828+
native      ====================(
829+
native
821830
*/
822831

823832
/**
@@ -992,7 +1001,10 @@ forward E_SERVER_RULE_FLAGS:GetServerRuleFlags(const rule[]);
9921001
*/
9931002

9941003
/*
995-
native #Client Config();
1004+
native # Client Config();
1005+
native         Client Config(
1006+
native      ====================(
1007+
native
9961008
*/
9971009

9981010
/**
@@ -1260,7 +1272,10 @@ native EnableZoneNames(bool:enable);
12601272
*/
12611273

12621274
/*
1263-
native #NPCs();
1275+
native # NPCs();
1276+
native              NPCs(
1277+
native      ====================(
1278+
native
12641279
*/
12651280

12661281
/**
@@ -1294,7 +1309,10 @@ native ConnectNPC(const name[], const script[]);
12941309
*/
12951310

12961311
/*
1297-
native #Deprecated();
1312+
native # Deprecated();
1313+
native           Deprecated(
1314+
native      ====================(
1315+
native
12981316
*/
12991317

13001318
// These three functions are like this for qawno.

omp_database.inc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ static stock SQLITE_OPEN:_@SQLITE_OPEN() { return __SQLITE_OPEN; }
9797
*/
9898

9999
/*
100-
native #Modern API();
100+
native # Modern API();
101+
native           Modern API(
102+
native      ====================(
103+
native
101104
*/
102105

103106
/**
@@ -306,7 +309,10 @@ native DB_GetDatabaseResultSetCount();
306309
*/
307310

308311
/*
309-
native #Deprecated Legacy();
312+
native # Deprecated Legacy();
313+
native       Deprecated Legacy(
314+
native      ====================(
315+
native
310316
*/
311317

312318
/**
@@ -433,7 +439,10 @@ native db_debug_openresults() = DB_GetDatabaseResultSetCount;
433439
*/
434440

435441
/*
436-
native #Deprecated Compat();
442+
native # Deprecated Compat();
443+
native       Deprecated Compat(
444+
native      ====================(
445+
native
437446
*/
438447

439448
/**

omp_dialog.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ native GetPlayerDialogID(playerid);
161161
*/
162162

163163
/*
164-
native #Deprecated();
164+
native # Deprecated();
165+
native           Deprecated(
166+
native      ====================(
167+
native
165168
*/
166169

167170
/**

omp_gangzone.inc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ const INVALID_GANG_ZONE = 0xFFFFFFFF;
6262
*/
6363

6464
/*
65-
native #Global();
65+
native # Global();
66+
native             Global(
67+
native      ====================(
68+
native
6669
*/
6770

6871
/**
@@ -318,7 +321,10 @@ native UseGangZoneCheck(zoneid, bool:enable);
318321
*/
319322

320323
/*
321-
native #Per-Player();
324+
native # Per-Player();
325+
native           Per-Player(
326+
native      ====================(
327+
native
322328
*/
323329

324330
/**
@@ -410,7 +416,10 @@ native UsePlayerGangZoneCheck(zoneid, bool:enable);
410416
*/
411417

412418
/*
413-
native #Deprecated();
419+
native # Deprecated();
420+
native           Deprecated(
421+
native      ====================(
422+
native
414423
*/
415424

416425
/**

omp_network.inc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ native SendClientCheck(playerid, type, memoryAddress, memoryOffset, byteCount);
310310
*/
311311

312312
/*
313-
native #Netstats();
313+
native # Netstats();
314+
native            Netstats(
315+
native      ====================(
316+
native
314317
*/
315318

316319
/**
@@ -525,7 +528,10 @@ native NetStats_GetIpPort(playerid, output[], size = sizeof (output));
525528
*/
526529

527530
/*
528-
native #Formatted();
531+
native # Formatted();
532+
native           Formatted(
533+
native      ====================(
534+
native
529535
*/
530536

531537
/**
@@ -607,7 +613,10 @@ native GetPlayerNetworkStats(playerid, output[], size = sizeof (output));
607613
*/
608614

609615
/*
610-
native #Deprecated();
616+
native # Deprecated();
617+
native           Deprecated(
618+
native      ====================(
619+
native
611620
*/
612621

613622
/**

omp_object.inc

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,10 @@ native bool:AttachPlayerObjectToObject(playerid, objectid, parentid, Float:offse
246246
*/
247247

248248
/*
249-
native #Global();
249+
native # Global();
250+
native             Global(
251+
native      ====================(
252+
native
250253
*/
251254

252255
/**
@@ -743,7 +746,10 @@ stock bool:HasObjectCameraCollision(objectid)
743746
*/
744747

745748
/*
746-
native #Per-Player();
749+
native # Per-Player();
750+
native           Per-Player(
751+
native      ====================(
752+
native
747753
*/
748754

749755
/**
@@ -1206,7 +1212,10 @@ native bool:GetPlayerObjectMovingTargetRot(playerid, objectid, &Float:rotationX,
12061212
*/
12071213

12081214
/*
1209-
native #Attachments();
1215+
native # Attachments();
1216+
native          Attachments(
1217+
native      ====================(
1218+
native
12101219
*/
12111220

12121221
/**
@@ -1334,7 +1343,10 @@ native EditAttachedObject(playerid, index);
13341343
*/
13351344

13361345
/*
1337-
native #DL();
1346+
native # DL();
1347+
native               DL(
1348+
native      ====================(
1349+
native
13381350
*/
13391351

13401352
/**
@@ -1393,7 +1405,10 @@ native bool:IsValidCustomModel(modelid);
13931405
*/
13941406

13951407
/*
1396-
native #Deprecated();
1408+
native # Deprecated();
1409+
native           Deprecated(
1410+
native      ====================(
1411+
native
13971412
*/
13981413

13991414
/**

omp_pickup.inc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ const INVALID_PICKUP = -1;
6262
*/
6363

6464
/*
65-
native #Global();
65+
native # Global();
66+
native             Global(
67+
native      ====================(
68+
native
6669
*/
6770

6871
/**
@@ -255,7 +258,10 @@ native bool:IsPickupHiddenForPlayer(playerid, pickupid);
255258
*/
256259

257260
/*
258-
native #Per-Player();
261+
native # Per-Player();
262+
native           Per-Player(
263+
native      ====================(
264+
native
259265
*/
260266

261267
/**

omp_player.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2842,7 +2842,10 @@ native bool:ArePlayerWeaponsAllowed(playerid);
28422842
*/
28432843

28442844
/*
2845-
native #Deprecated();
2845+
native # Deprecated();
2846+
native           Deprecated(
2847+
native      ====================(
2848+
native
28462849
*/
28472850

28482851
/**

0 commit comments

Comments
 (0)