Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax test files for some languages #1381

Merged
merged 1 commit into from
Nov 23, 2020
Merged

Syntax test files for some languages #1381

merged 1 commit into from
Nov 23, 2020

Conversation

h3nill
Copy link
Contributor

@h3nill h3nill commented Nov 14, 2020

re: #1213

After hacktoberfest I didn't see any activity on the issue, so I have added basic test files for bolded languages on the issue.

Now only remaining is Regular Expression. What kind of structure of the file should be (as in just regular expression each on a new line)? and should it be PCRE, or javascript one?

@sharkdp
Copy link
Owner

sharkdp commented Nov 15, 2020

I have added basic test files for bolded languages on the issue.

Awesome - thank you! Where do these files come from? Did you write them yourself? Or do we need LICENSE files for them?

What kind of structure of the file should be (as in just regular expression each on a new line)? and should it be PCRE, or javascript one?

The syntax file says:

%YAML 1.2
---
name: Regular Expression
comment: Matches PCRE's regexp syntax, used in various languages and in
  Sublime Text for the Find panels
file_extensions:
  - re

So I think either a single line PCRE regex or maybe a multi-line regex, but not multiple regexes on multiple lines.

@h3nill
Copy link
Contributor Author

h3nill commented Nov 15, 2020

Awesome - thank you! Where do these files come from? Did you write them yourself? Or do we need LICENSE files for them?

I have hacked them from either language's documentation and/or took reference from learningxinyminutes, so I don't think that would require any license.

So I think either a single line PCRE regex or maybe a multi-line regex, but not multiple regexes on multiple lines.

So email regex from this, should work?
I have validated it, you can check it out: https://regex101.com/r/UQ2Sap/2

@h3nill
Copy link
Contributor Author

h3nill commented Nov 15, 2020

So the syntax's for which test are added:

  • ASP
  • AppleScript
  • Objective-C
  • Objective-C++
  • Regular Expression
  • Ruby on Rails
  • Tcl
  • Textile
  • Fish

@sharkdp
Copy link
Owner

sharkdp commented Nov 23, 2020

I have hacked them from either language's documentation and/or took reference from learningxinyminutes, so I don't think that would require any license.

👍

So email regex from this, should work?

In principle, yes. But note that StackOverflow has a non-trivial license file. We can't just copy that regex into our code base without attribution.

A simpler self-written regex (maybe from our own Manpage sublime syntax) would also be a good start.

@h3nill
Copy link
Contributor Author

h3nill commented Nov 23, 2020

I wanted to use as many regex identifiers(not sure if that's the correct word) as possible but then it's hard to come up with a useful regex. Although I think usefulness is not a concern here so I have came up with this:

^[START]\d\D\h\H\s\S[a-z]\v\V\w\W.([a-z]){3,5}[END]$

And this matches

[START]1a b cd
ef$ghijhk[END]

Would that be okay?

PS: Check failed due to unrelated reasons

@sharkdp
Copy link
Owner

sharkdp commented Nov 23, 2020

Would that be okay?

Yes, thanks!

PS: Check failed due to unrelated reasons

Yes. That was my bad. It should hopefully work if you rebase on master.

@sharkdp sharkdp merged commit 591eba6 into sharkdp:master Nov 23, 2020
@sharkdp
Copy link
Owner

sharkdp commented Nov 23, 2020

Thank you!

@h3nill h3nill deleted the add-many-syntaxes branch December 31, 2020 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants