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
691 opcode = tok;691 opcode = tok;
692 next();692 next();
693 if (tok == ':') {693 if (tok == ':') {
694 char * label = get_tok_str(opcode, NULL);
695
694 /* new label */696 /* new label */
695 asm_new_label(s1, opcode, 0);697 asm_new_label(s1, opcode,
698 (label && label[0] == '.' && label[1] == 'L') ? 1 : 0);
696 next();699 next();
697 goto redo;700 goto redo;
698 } else if (tok == '=') {701 } else if (tok == '=') {
tccpp.c+6−0
@@ -2279,6 +2279,12 @@ maybe_newline: · 2278 unmodified lines
2279 tok = TOK_PPNUM;2279 tok = TOK_PPNUM;
2280 break;2280 break;
2281 case '.':2281 case '.':
2282 /* check first for a local label (.Lxx:) */
2283 if (p[1] == 'L') {
2284 /* fast case */
2285 goto parse_ident_fast;
2286 }
2287
2282 /* special dot handling because it can also start a number */2288 /* special dot handling because it can also start a number */
2283 PEEKC(c, p);2289 PEEKC(c, p);
2284 if (isnum(c)) {2290 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