parser: Check and prompt for empty patterns and region properties (fix crash) by JoeKar · Pull Request #3256 · micro-editor/micro (original) (raw)
Navigation Menu
Appearance settings
- AI CODE CREATION
* GitHub CopilotWrite better code with AI
* GitHub SparkBuild and deploy intelligent apps
* GitHub ModelsManage and compare prompts
* MCP RegistryNewIntegrate external tools - DEVELOPER WORKFLOWS
* ActionsAutomate any workflow
* CodespacesInstant dev environments
* IssuesPlan and track work
* Code ReviewManage code changes - APPLICATION SECURITY
* GitHub Advanced SecurityFind and fix vulnerabilities
* Code securitySecure your code as you build
* Secret protectionStop leaks before they start - EXPLORE
* Why GitHub
* Documentation
* Blog
* Changelog
* Marketplace
- AI CODE CREATION
- BY COMPANY SIZE
* Enterprises
* Small and medium teams
* Startups
* Nonprofits - BY USE CASE
* App Modernization
* DevSecOps
* DevOps
* CI/CD
* View all use cases - BY INDUSTRY
* Healthcare
* Financial services
* Manufacturing
* Government
* View all industries
- BY COMPANY SIZE
- EXPLORE BY TOPIC
* AI
* Software Development
* DevOps
* Security
* View all topics - EXPLORE BY TYPE
* Customer stories
* Events & webinars
* Ebooks & reports
* Business insights
* GitHub Skills - SUPPORT & SERVICES
* Documentation
* Customer support
* Community forum
* Trust center
* Partners
- EXPLORE BY TOPIC
- COMMUNITY
* GitHub SponsorsFund open source developers - PROGRAMS
* Security Lab
* Maintainer Community
* Accelerator
* GitHub Stars
* Archive Program - REPOSITORIES
* Topics
* Trending
* Collections
- COMMUNITY
- Pricing
Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
micro-editor / micro Public
Notifications You must be signed in to change notification settings
Additional navigation options
Merged
JoeKar merged 3 commits intomicro-editor:masterfrom
Apr 21, 2024
ConversationCommits (3)ChecksFiles changed
Merged
parser: Check and prompt for empty patterns and region properties (fix crash)#3256
JoeKar merged 3 commits intomicro-editor:masterfrom
Conversation
Copy link Copy Markdown
Member
JoeKar commented
By checking for broken syntax definitions in the parsing step we're able to prevent a possible recursion in the current highlighter engine. As a positive side effect we create more precise error messages for the user to help fixing the issues.
Fixes #3253
[parser: Precise error message for missing start & end in region](/micro-editor/micro/pull/3256/commits/52cb1663444f99826c3a9bf0e6ea5dd9972655a6 "parser: Precise error message for missing `start` & `end` in region")
[52cb166](/micro-editor/micro/pull/3256/commits/52cb1663444f99826c3a9bf0e6ea5dd9972655a6)
Copy link Copy Markdown
Member Author
JoeKar commented
@Andriamanitra:
Does this fit your expectation?
@taconi:
Can you please verify the change done in your prepared log definition?
Andriamanitra reviewed Apr 16, 2024
Copy link Copy Markdown
Contributor
Andriamanitra left a comment
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Andriamanitra:
Does this fit your expectation?
Yup, the behavior is exactly what I meant!
pkg/highlight/parser.go Outdated Show resolved Hide resolved
JoeKar added 2 commits
[parser: Check and prompt for empty patterns and region properties](/micro-editor/micro/pull/3256/commits/e5f4b94812e505f48a9074e68827bfafe7a28e1f "parser: Check and prompt for empty patterns and region properties")
[e5f4b94](/micro-editor/micro/pull/3256/commits/e5f4b94812e505f48a9074e68827bfafe7a28e1f)
[syntax: Remove empty identifier pattern from log definition](/micro-editor/micro/pull/3256/commits/c71a55ff86f5c0c4e264b7ceea0caafab7d45423 "syntax: Remove empty identifier pattern from log definition")
[c71a55f](/micro-editor/micro/pull/3256/commits/c71a55ff86f5c0c4e264b7ceea0caafab7d45423)
JoeKar force-pushed the fix/parser-empty-regex branch fromec3b738 toc71a55f Compare
Copy link Copy Markdown
ghost commented
@taconi:
Can you please verify the change done in your prepared log definition?
It's perfect.
JoeKar mentioned this pull request
Add syntax highlight code for log files #3105
Merged
dmaluka approved these changes Apr 21, 2024
JoeKar merged commit c3052b4 into micro-editor:master
JoeKar deleted the fix/parser-empty-regex branch
Andriamanitra mentioned this pull request
Fix Ocaml syntax highlighting#3427
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Sign up for free to join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
dmaluka dmaluka approved these changes
+1 more reviewer
Andriamanitra Andriamanitra left review comments
Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
crash when syntax file is not complete?