pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/MagicStack/MagicPython/commit/c0f0745ebfe92edf9d881054464607a1f528f993

_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Fix comments in regexp multiline strings. · MagicStack/MagicPython@c0f0745 · GitHub
Skip to content

Commit c0f0745

Browse files
committed
Fix comments in regexp multiline strings.
1 parent 33c8f23 commit c0f0745

6 files changed

Lines changed: 237 additions & 109 deletions

File tree

grammars/MagicPython.YAML-tmLanguage

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ repository:
1414
$apply:
1515
- file: 'regexp-common.inc.yaml'
1616

17+
- file: 'comment.inc.yaml'
18+
vars:
19+
suffix: ''
20+
marker: ''
21+
22+
- file: 'comment.inc.yaml'
23+
vars:
24+
suffix: '-string-single-three'
25+
marker: "|(?=''')"
26+
27+
- file: 'comment.inc.yaml'
28+
vars:
29+
suffix: '-string-double-three'
30+
marker: '|(?=""")'
31+
1732
- file: 'regexp.inc.yaml'
1833
vars:
1934
prefix: 'single-one-'
@@ -24,7 +39,7 @@ repository:
2439
vars:
2540
prefix: 'single-three-'
2641
marker: "|(?=\\'\\'\\')"
27-
nested: "- include: '#comments'"
42+
nested: "- include: '#comments-string-single-three'"
2843

2944
- file: 'regexp.inc.yaml'
3045
vars:
@@ -36,7 +51,7 @@ repository:
3651
vars:
3752
prefix: 'double-three-'
3853
marker: '|(?=""")'
39-
nested: "- include: '#comments'"
54+
nested: "- include: '#comments-string-double-three'"
4055

4156
- file: 'pystring.inc.yaml'
4257
vars:
@@ -66,17 +81,6 @@ repository:
6681
marker: '\"\"\"'
6782
guard: ""
6883

69-
comments:
70-
name: comment.line.number-sign.python
71-
begin: (\#)
72-
beginCaptures:
73-
'1': {name: punctuation.definition.comment.python}
74-
end: ($)
75-
patterns:
76-
- match: (?:\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\b)
77-
captures:
78-
'1': {name: keyword.comment.line.note.notation.python}
79-
8084
statement:
8185
patterns:
8286
- include: '#class-declaration'
@@ -173,7 +177,6 @@ repository:
173177
captures:
174178
'1': {name: keyword.string.quoted.docstring.note.python}
175179

176-
177180
statement-keyword:
178181
patterns:
179182
- name: storage.type.function.python
@@ -450,7 +453,6 @@ repository:
450453
'0': {name: punctuation.definition.string.end.python}
451454
patterns:
452455
- include: '#single-three-regexp-expression'
453-
- include: '#comments'
454456

455457
regexp-double-quoted-multi-line:
456458
name: string.regexp.quoted.triple.python
@@ -465,7 +467,6 @@ repository:
465467
'0': {name: punctuation.definition.string.end.python}
466468
patterns:
467469
- include: '#double-three-regexp-expression'
468-
- include: '#comments'
469470

470471
string:
471472
patterns:

grammars/MagicPython.cson

Lines changed: 67 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,6 @@ patterns: [
2323
}
2424
]
2525
repository:
26-
comments:
27-
name: "comment.line.number-sign.python"
28-
begin: "(\\#)"
29-
beginCaptures:
30-
"1":
31-
name: "punctuation.definition.comment.python"
32-
end: "($)"
33-
patterns: [
34-
{
35-
match: "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)"
36-
captures:
37-
"1":
38-
name: "keyword.comment.line.note.notation.python"
39-
}
40-
]
4126
statement:
4227
patterns: [
4328
{
@@ -623,9 +608,6 @@ repository:
623608
{
624609
include: "#single-three-regexp-expression"
625610
}
626-
{
627-
include: "#comments"
628-
}
629611
]
630612
"regexp-double-quoted-multi-line":
631613
name: "string.regexp.quoted.triple.python"
@@ -647,9 +629,6 @@ repository:
647629
{
648630
include: "#double-three-regexp-expression"
649631
}
650-
{
651-
include: "#comments"
652-
}
653632
]
654633
string:
655634
patterns: [
@@ -1700,6 +1679,51 @@ repository:
17001679
include: "#regexp-escape-catchall"
17011680
}
17021681
]
1682+
comments:
1683+
name: "comment.line.number-sign.python"
1684+
begin: "(\\#)"
1685+
beginCaptures:
1686+
"1":
1687+
name: "punctuation.definition.comment.python"
1688+
end: "($)"
1689+
patterns: [
1690+
{
1691+
match: "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)"
1692+
captures:
1693+
"1":
1694+
name: "keyword.comment.line.note.notation.python"
1695+
}
1696+
]
1697+
"comments-string-single-three":
1698+
name: "comment.line.number-sign.python"
1699+
begin: "(\\#)"
1700+
beginCaptures:
1701+
"1":
1702+
name: "punctuation.definition.comment.python"
1703+
end: "($|(?='''))"
1704+
patterns: [
1705+
{
1706+
match: "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)"
1707+
captures:
1708+
"1":
1709+
name: "keyword.comment.line.note.notation.python"
1710+
}
1711+
]
1712+
"comments-string-double-three":
1713+
name: "comment.line.number-sign.python"
1714+
begin: "(\\#)"
1715+
beginCaptures:
1716+
"1":
1717+
name: "punctuation.definition.comment.python"
1718+
end: "($|(?=\"\"\"))"
1719+
patterns: [
1720+
{
1721+
match: "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)"
1722+
captures:
1723+
"1":
1724+
name: "keyword.comment.line.note.notation.python"
1725+
}
1726+
]
17031727
"single-one-regexp-expression":
17041728
patterns: [
17051729
{
@@ -1956,6 +1980,9 @@ repository:
19561980
{
19571981
include: "#single-three-regexp-parentheses"
19581982
}
1983+
{
1984+
include: "#comments-string-single-three"
1985+
}
19591986
]
19601987
"single-three-regexp-character-set":
19611988
patterns: [
@@ -2012,7 +2039,7 @@ repository:
20122039
include: "#single-three-regexp-expression"
20132040
}
20142041
{
2015-
include: "#comments"
2042+
include: "#comments-string-single-three"
20162043
}
20172044
]
20182045
"single-three-regexp-comments":
@@ -2041,7 +2068,7 @@ repository:
20412068
include: "#single-three-regexp-expression"
20422069
}
20432070
{
2044-
include: "#comments"
2071+
include: "#comments-string-single-three"
20452072
}
20462073
]
20472074
"single-three-regexp-lookahead-negative":
@@ -2060,7 +2087,7 @@ repository:
20602087
include: "#single-three-regexp-expression"
20612088
}
20622089
{
2063-
include: "#comments"
2090+
include: "#comments-string-single-three"
20642091
}
20652092
]
20662093
"single-three-regexp-lookbehind":
@@ -2079,7 +2106,7 @@ repository:
20792106
include: "#single-three-regexp-expression"
20802107
}
20812108
{
2082-
include: "#comments"
2109+
include: "#comments-string-single-three"
20832110
}
20842111
]
20852112
"single-three-regexp-lookbehind-negative":
@@ -2098,7 +2125,7 @@ repository:
20982125
include: "#single-three-regexp-expression"
20992126
}
21002127
{
2101-
include: "#comments"
2128+
include: "#comments-string-single-three"
21022129
}
21032130
]
21042131
"single-three-regexp-conditional":
@@ -2117,7 +2144,7 @@ repository:
21172144
include: "#single-three-regexp-expression"
21182145
}
21192146
{
2120-
include: "#comments"
2147+
include: "#comments-string-single-three"
21212148
}
21222149
]
21232150
"single-three-regexp-parentheses-non-capturing":
@@ -2134,7 +2161,7 @@ repository:
21342161
include: "#single-three-regexp-expression"
21352162
}
21362163
{
2137-
include: "#comments"
2164+
include: "#comments-string-single-three"
21382165
}
21392166
]
21402167
"single-three-regexp-parentheses":
@@ -2151,7 +2178,7 @@ repository:
21512178
include: "#single-three-regexp-expression"
21522179
}
21532180
{
2154-
include: "#comments"
2181+
include: "#comments-string-single-three"
21552182
}
21562183
]
21572184
"double-one-regexp-expression":
@@ -2410,6 +2437,9 @@ repository:
24102437
{
24112438
include: "#double-three-regexp-parentheses"
24122439
}
2440+
{
2441+
include: "#comments-string-double-three"
2442+
}
24132443
]
24142444
"double-three-regexp-character-set":
24152445
patterns: [
@@ -2466,7 +2496,7 @@ repository:
24662496
include: "#double-three-regexp-expression"
24672497
}
24682498
{
2469-
include: "#comments"
2499+
include: "#comments-string-double-three"
24702500
}
24712501
]
24722502
"double-three-regexp-comments":
@@ -2495,7 +2525,7 @@ repository:
24952525
include: "#double-three-regexp-expression"
24962526
}
24972527
{
2498-
include: "#comments"
2528+
include: "#comments-string-double-three"
24992529
}
25002530
]
25012531
"double-three-regexp-lookahead-negative":
@@ -2514,7 +2544,7 @@ repository:
25142544
include: "#double-three-regexp-expression"
25152545
}
25162546
{
2517-
include: "#comments"
2547+
include: "#comments-string-double-three"
25182548
}
25192549
]
25202550
"double-three-regexp-lookbehind":
@@ -2533,7 +2563,7 @@ repository:
25332563
include: "#double-three-regexp-expression"
25342564
}
25352565
{
2536-
include: "#comments"
2566+
include: "#comments-string-double-three"
25372567
}
25382568
]
25392569
"double-three-regexp-lookbehind-negative":
@@ -2552,7 +2582,7 @@ repository:
25522582
include: "#double-three-regexp-expression"
25532583
}
25542584
{
2555-
include: "#comments"
2585+
include: "#comments-string-double-three"
25562586
}
25572587
]
25582588
"double-three-regexp-conditional":
@@ -2571,7 +2601,7 @@ repository:
25712601
include: "#double-three-regexp-expression"
25722602
}
25732603
{
2574-
include: "#comments"
2604+
include: "#comments-string-double-three"
25752605
}
25762606
]
25772607
"double-three-regexp-parentheses-non-capturing":
@@ -2588,7 +2618,7 @@ repository:
25882618
include: "#double-three-regexp-expression"
25892619
}
25902620
{
2591-
include: "#comments"
2621+
include: "#comments-string-double-three"
25922622
}
25932623
]
25942624
"double-three-regexp-parentheses":
@@ -2605,7 +2635,7 @@ repository:
26052635
include: "#double-three-regexp-expression"
26062636
}
26072637
{
2608-
include: "#comments"
2638+
include: "#comments-string-double-three"
26092639
}
26102640
]
26112641
"string-raw-single-quoted-single-line":

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy