-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script/Bytecode styling #262
Comments
Command name styling: |
There is no reason to mandate subroutine prefixes on labels within the subroutine, as individual sequences are separate files in Gen4; every label within a single file is implicitly static, so the prefix is wholly unnecessary. You can have |
My choices for mirroring pokeemerald's style: Command name styling: |
A few things I should mention:
|
We should also note that, technically speaking, labels are implicitly local in DS scripts; they're individual files within an archive, not a collection of scripts stitched together and then compiled. |
Command name styling: |
Only matters for trainer AI, all other scripts are assembled and then extracted as binary anyway. |
I wasn't talking about object file compatibility, using a different assembler for different things is a mess. |
pfero — Today at 12:49 AM
|
We have no consensus on (4). |
This issue has had no activity for 60 days and will be marked stale. If there is no further activity, it will be closed in 30 days. |
This issue has had no activity for 60 days and will be marked stale. If there is no further activity, it will be closed in 30 days. |
Script/Bytecode styling
Probably don't need to explain what scripts are (e.g. trainer AI scripts, battle scripts, event scripts (if they're even called that in Gen 4)).
Shorthand for options are in the format ., e.g. for
snake_case
local labels, write3a.2
. But it's always good to mention what the option is anyway.Example format for what styling you want
Command name styling:
PascalCase
Entry-point label styling:
PascalCase
Use local labels: No
Within-subroutine label styling:
_UnderscorePrefixPascalCase
Copypasteable version:
1. There is no consensus for command name styling
Option 1:
PascalCase
Option 2:
alllowercase
Option 3:
snake_case
Option 4:
camelCase
2. There is no consensus for styling for "entry-point" or "subroutine" script labels
Option 1:
PascalCase
Option 2:
snake_case
Option 3:
camelCase
Option 4:
_UnderscorePrefixPascalCase
Note: Technically shouldn't be done because
_
prefix means a symbol is reserved. This should only matter for Trainer AI scripts which are linked with C files.Suggest more options in the comments.
3. There is no consensus for "within-subroutine" labels
This issue is a bit more complicated because it depends on whether you use mwasmarm or not. mwasmarm has true local label support, where a label goes out of scope after a non-local label, for example:
mwasmarm pros:
mwasmarm cons:
GNU assembler pros are the reverse of mwasmarm pros
GNU assembler cons (not mentioned above):
#define
s3a. If using local labels (mwasmarm assumed/forced)
Option 1:
@camelCase
Option 2:
@snake_case
Option 3:
@PascalCase
3b. If not using local labels
Option 1:
PascalCase_WithPascalCaseSubLabel
(impliesPascalCase
for entry-point label)Option 2:
PascalCase_withCamelCaseSubLabel
(impliesPascalCase
for entry-point label)Option 3:
PascalCase_with_snake_case_sub_label
(impliesPascalCase
for entry-point label)Option 4:
_underscorePrefixCamelCase
, just try to avoid label conflictsOption 5:
_UnderscorePrefixPascalCase
, just try to avoid label conflictsOption 6:
_underscore_prefix_snake_case
, just try to avoid label conflictsThe text was updated successfully, but these errors were encountered: