parser: Check and prompt for empty patterns and region properties (fix crash) by JoeKar · Pull Request #3256 · micro-editor/micro (original) (raw)

Skip to content

Sign in

Appearance settings

View all features

View all solutions

View all resources

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

Sign in

Sign up

Appearance settings

micro-editor / micro Public

Additional navigation options

Merged

JoeKar merged 3 commits intomicro-editor:masterfrom

JoeKar:fix/parser-empty-regex

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

JoeKar:fix/parser-empty-regex

Conversation

@JoeKar

Copy link Copy Markdown

Member

@JoeKar JoeKar commented

Apr 16, 2024

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

@JoeKar

[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)

@JoeKar

Copy link Copy Markdown

Member Author

JoeKar commented

Apr 16, 2024

@Andriamanitra:
Does this fit your expectation?

@taconi:
Can you please verify the change done in your prepared log definition?

Andriamanitra

Andriamanitra reviewed Apr 16, 2024

View reviewed changes

Copy link Copy Markdown

Contributor

@Andriamanitra 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

April 16, 2024 20:33

@JoeKar

[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)

@JoeKar

[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 JoeKar force-pushed the fix/parser-empty-regex branch fromec3b738 toc71a55f Compare

April 16, 2024 18:34

@ghost

Copy link Copy Markdown

ghost commented

Apr 16, 2024

@taconi:
Can you please verify the change done in your prepared log definition?

It's perfect.

@JoeKar JoeKar mentioned this pull request

Apr 17, 2024

Add syntax highlight code for log files #3105

Merged

dmaluka

dmaluka approved these changes Apr 21, 2024

View reviewed changes

@JoeKar JoeKar merged commit c3052b4 into micro-editor:master

Apr 21, 2024

@JoeKar JoeKar deleted the fix/parser-empty-regex branch

April 21, 2024 18:13

@Andriamanitra Andriamanitra mentioned this pull request

Aug 15, 2024

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 dmaluka approved these changes

+1 more reviewer

@Andriamanitra 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?

3 participants

@JoeKar @dmaluka @Andriamanitra