Commit 91e58fe
committed
In the macro definition (#define/#macro), "##_" is used to indicate the dynamic addition of a line continuation character ("_"), Causes the compiler to delay parsing the line continuation.This allows multiple lines of code in the input file to be combined into a single statement. For example:
Type _MAP_ENTRY
id As integer
pA As integer
End Type
#macro BEGIN_ENTRIESMAP()
Function _GetMapEntries() As _MAP_ENTRY Ptr
Static As _MAP_ENTRY _entries(0 To ...) = { ##_
#endmacro
#macro END_ENTRIESMAP()
(0, 0)}
Return @_entries(0)
End Function
#endmacro
#define _INTERFACE_ENTRY(x, y) (x, y), ##_
BEGIN_ENTRIESMAP()
_INTERFACE_ENTRY(1, 2)
_INTERFACE_ENTRY(3, 4)
_INTERFACE_ENTRY(5, 6)
END_ENTRIESMAP()
/' Compiler parsing results:
Function _GetMapEntries() As _MAP_ENTRY Ptr
Static As _MAP_ENTRY _entries(0 To ...) = { _
(1, 2), _
(3, 4), _
(5, 6), _
(0, 0)}
Return @_entries(0)
End Function
'/1 parent ea8c233 commit 91e58fe
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
960 | | - | |
| 960 | + | |
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
549 | 557 | | |
550 | 558 | | |
551 | 559 | | |
| |||
689 | 697 | | |
690 | 698 | | |
691 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
692 | 708 | | |
693 | 709 | | |
694 | 710 | | |
| |||
0 commit comments