|
4 | 4 | "If you want to provide a fix or improvement, please create a pull request against the original repository.", |
5 | 5 | "Once accepted there, we are happy to receive an update request." |
6 | 6 | ], |
7 | | - "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/9c4f4b3291538d9f5144f02d3b6af877b84f2cb2", |
| 7 | + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/1a24b4aa383169919f0d92cf2735ac35a3e7db3c", |
8 | 8 | "name": "C", |
9 | 9 | "scopeName": "source.c", |
10 | 10 | "patterns": [ |
|
374 | 374 | "repository": { |
375 | 375 | "default_statement": { |
376 | 376 | "name": "meta.conditional.case.c", |
377 | | - "begin": "((?<!\\w)default(?!\\w))", |
| 377 | + "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)default(?!\\w))", |
378 | 378 | "beginCaptures": { |
379 | 379 | "1": { |
| 380 | + "patterns": [ |
| 381 | + { |
| 382 | + "include": "#inline_comment" |
| 383 | + } |
| 384 | + ] |
| 385 | + }, |
| 386 | + "2": { |
| 387 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 388 | + }, |
| 389 | + "3": { |
| 390 | + "name": "comment.block.c" |
| 391 | + }, |
| 392 | + "4": { |
| 393 | + "patterns": [ |
| 394 | + { |
| 395 | + "match": "\\*\\/", |
| 396 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 397 | + }, |
| 398 | + { |
| 399 | + "match": "\\*", |
| 400 | + "name": "comment.block.c" |
| 401 | + } |
| 402 | + ] |
| 403 | + }, |
| 404 | + "5": { |
380 | 405 | "name": "keyword.control.default.c" |
381 | 406 | } |
382 | 407 | }, |
383 | 408 | "end": "(:)", |
384 | 409 | "endCaptures": { |
385 | 410 | "1": { |
386 | | - "name": "colon.c punctuation.separator.case.default.c" |
| 411 | + "name": "punctuation.separator.colon.case.default.c" |
387 | 412 | } |
388 | 413 | }, |
389 | 414 | "patterns": [ |
|
397 | 422 | }, |
398 | 423 | "case_statement": { |
399 | 424 | "name": "meta.conditional.case.c", |
400 | | - "begin": "((?<!\\w)case(?!\\w))", |
| 425 | + "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)case(?!\\w))", |
401 | 426 | "beginCaptures": { |
402 | 427 | "1": { |
| 428 | + "patterns": [ |
| 429 | + { |
| 430 | + "include": "#inline_comment" |
| 431 | + } |
| 432 | + ] |
| 433 | + }, |
| 434 | + "2": { |
| 435 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 436 | + }, |
| 437 | + "3": { |
| 438 | + "name": "comment.block.c" |
| 439 | + }, |
| 440 | + "4": { |
| 441 | + "patterns": [ |
| 442 | + { |
| 443 | + "match": "\\*\\/", |
| 444 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 445 | + }, |
| 446 | + { |
| 447 | + "match": "\\*", |
| 448 | + "name": "comment.block.c" |
| 449 | + } |
| 450 | + ] |
| 451 | + }, |
| 452 | + "5": { |
403 | 453 | "name": "keyword.control.case.c" |
404 | 454 | } |
405 | 455 | }, |
406 | 456 | "end": "(:)", |
407 | 457 | "endCaptures": { |
408 | 458 | "1": { |
409 | | - "name": "colon.c punctuation.separator.case.c" |
| 459 | + "name": "punctuation.separator.colon.case.c" |
410 | 460 | } |
411 | 461 | }, |
412 | 462 | "patterns": [ |
|
420 | 470 | }, |
421 | 471 | "switch_statement": { |
422 | 472 | "name": "meta.block.switch.c", |
423 | | - "begin": "(((?<!\\w)switch(?!\\w)))", |
| 473 | + "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)switch(?!\\w)))", |
424 | 474 | "beginCaptures": { |
425 | 475 | "1": { |
426 | 476 | "name": "meta.head.switch.c" |
427 | 477 | }, |
428 | 478 | "2": { |
| 479 | + "patterns": [ |
| 480 | + { |
| 481 | + "include": "#inline_comment" |
| 482 | + } |
| 483 | + ] |
| 484 | + }, |
| 485 | + "3": { |
| 486 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 487 | + }, |
| 488 | + "4": { |
| 489 | + "name": "comment.block.c" |
| 490 | + }, |
| 491 | + "5": { |
| 492 | + "patterns": [ |
| 493 | + { |
| 494 | + "match": "\\*\\/", |
| 495 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 496 | + }, |
| 497 | + { |
| 498 | + "match": "\\*", |
| 499 | + "name": "comment.block.c" |
| 500 | + } |
| 501 | + ] |
| 502 | + }, |
| 503 | + "6": { |
429 | 504 | "name": "keyword.control.switch.c" |
430 | 505 | } |
431 | 506 | }, |
|
487 | 562 | }, |
488 | 563 | "switch_conditional_parentheses": { |
489 | 564 | "name": "meta.conditional.switch.c", |
490 | | - "begin": "(\\()", |
| 565 | + "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", |
491 | 566 | "beginCaptures": { |
492 | 567 | "1": { |
| 568 | + "patterns": [ |
| 569 | + { |
| 570 | + "include": "#inline_comment" |
| 571 | + } |
| 572 | + ] |
| 573 | + }, |
| 574 | + "2": { |
| 575 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 576 | + }, |
| 577 | + "3": { |
| 578 | + "name": "comment.block.c" |
| 579 | + }, |
| 580 | + "4": { |
| 581 | + "patterns": [ |
| 582 | + { |
| 583 | + "match": "\\*\\/", |
| 584 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 585 | + }, |
| 586 | + { |
| 587 | + "match": "\\*", |
| 588 | + "name": "comment.block.c" |
| 589 | + } |
| 590 | + ] |
| 591 | + }, |
| 592 | + "5": { |
493 | 593 | "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c" |
494 | 594 | } |
495 | 595 | }, |
|
580 | 680 | "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", |
581 | 681 | "beginCaptures": { |
582 | 682 | "1": { |
583 | | - "name": "comma.c punctuation.separator.delimiter.c" |
| 683 | + "name": "punctuation.separator.delimiter.comma.c" |
584 | 684 | } |
585 | 685 | }, |
586 | 686 | "end": "(?=\\))", |
|
0 commit comments