History

tccpp: Allow local labels to start with a dot

-- By by ... Detlef

Detlef Riekenberg committed 16 years ago

Commit f7404851 parent 9ff7a0b2 files · +10 −1Browse files

Unified · Split

2 files
  1. tccasm.c +4 −1
  2. tccpp.c +6 −0
tccasm.c+4−1
@@ -691,8 +691,11 @@ static int tcc_assemble_internal(TCCState *s1, int do_preprocess) · 690 unmodified lines
691691 opcode = tok;
692692 next();
693693 if (tok == ':') {
694+ char * label = get_tok_str(opcode, NULL);
695+
694696 /* new label */
695− asm_new_label(s1, opcode, 0);
697+ asm_new_label(s1, opcode,
698+ (label && label[0] == '.' && label[1] == 'L') ? 1 : 0);
696699 next();
697700 goto redo;
698701 } else if (tok == '=') {
tccpp.c+6−0
@@ -2279,6 +2279,12 @@ maybe_newline: · 2278 unmodified lines
22792279 tok = TOK_PPNUM;
22802280 break;
22812281 case '.':
2282+ /* check first for a local label (.Lxx:) */
2283+ if (p[1] == 'L') {
2284+ /* fast case */
2285+ goto parse_ident_fast;
2286+ }
2287+
22822288 /* special dot handling because it can also start a number */
22832289 PEEKC(c, p);
22842290 if (isnum(c)) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t