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

added Raku info to languages.json #364

Merged
merged 1 commit into from Jan 10, 2023
Merged

Conversation

masukomi
Copy link
Contributor

@masukomi masukomi commented Jan 3, 2023

Fixes Issue #362

source refereneces

Source for 99% of the complexity stuff is here in the Raku docs

The all-caps ones are Phasers and I think they should be included but I'm not 100% sure.

All the various quote marks come from here in the grammar

except for « and » which are actually defined a few times in a few ways in the grammar (context alters meaning) Sometimes they function as quote marks. Sometimes they're...more.

[edit]: added react and whenever from the concurrency docs.

Notes

Also of note is "emit" which is in the flow control docs but wasn't clear if it should be included for the complexity check or not.

I've also specifically not included tests like < and lt because other languages seemed to not include those.

I've also removed perl6 from the shebang list
for perl since perl6 is a different language
(now called raku).

⚠️ there is overlap between Perl and Raku with regards to some extensions. As noted in issue #362

The old .p6 (or .pl6), .pm6 (or .pm which is also supported, but discouraged) and .pod6 extensions will continue to be supported for 6.e and marked as deprecated in 6.f. We're currently at v6.d so we've got a while before those are officially deprecated. That being said, you're not going to find them in any new codebases so I'm not sure anyone would care.

My recommendation would be to remove those from this PR because no-one's using them anymore and a fair amount of that ancient code with old extensions doesn't work anymore anyways. Just holler and I'll make that change.

License Declaration

I Kay Rhodes (a.k.a masukomi) explicitly license this contribution under the MIT AND Unlicense licenses.

@boyter
Copy link
Owner

boyter commented Jan 3, 2023

If you think the change to remove them, is worth it lets do that. Im happy to go along with whatever you suggest.

@boyter
Copy link
Owner

boyter commented Jan 3, 2023

Let me know if you want to do it, otherwise ill merge and all good.

@masukomi
Copy link
Contributor Author

masukomi commented Jan 3, 2023

force-pushed after adding react { and whenever (and sorting so we could find things) based on some feedback I got.

I'll remove those extensions tomorrow. Let's let it sit a few days to see if i can get some more eyes on it from people more experienced with Raku than me.

@boyter
Copy link
Owner

boyter commented Jan 4, 2023

Works for me. Say the word and ill merge it in.

@masukomi masukomi force-pushed the raku_support_362 branch 2 times, most recently from ecab9cc to c507bd5 Compare January 5, 2023 14:59
@masukomi
Copy link
Contributor Author

masukomi commented Jan 5, 2023

Update: rebased and force-pushed with the following changes to what was there already

  • removed deprecated raku file extensions
  • based on this comment I have added in the remaining comparators for numbers and strings
  • added in the missing unicode equivalents for the various number comparators raku supports documentation here
  • added set comparators

Note that I haven't added ALL of the unicode things, just the ones that match up to comparators, as things like multiplication and assignment (of which raku has many forms) don't seem to be included in languages.json for any language after a quick skim.

note: also removed perl6 from the shebang list
for perl since perl6 is a different language
(now called raku)
@masukomi
Copy link
Contributor Author

masukomi commented Jan 5, 2023

.... and another

  • added more multiline comment forms

Open question: Raku has something similar to Ruby's Heredocs. It's unclear how to encode that in languages.json so i haven't included it.

in Raku we've got

my $foo = q:to/END/
some stuff
END

and

my $foo = qq:to/END/
more stuff
END

"END" could be any text. THe compiler just scans the following lines until it sees a line with only that on it.

q vs qq at the start controls the handling of interpolation within the string.

(there may be other q variants i haven't found yet.. docs are harder to find on this)

in ruby you've got the same thing

query = <<-SQL
SELECT * FROM food
WHERE healthy = true
SQL

and

query = <<~SQL
SELECT * FROM food
WHERE healthy = true
SQL

`<<-` vs `<<~` is relative to how it handles indentation

@boyter boyter mentioned this pull request Jan 5, 2023
@boyter
Copy link
Owner

boyter commented Jan 5, 2023

That is an edge case that currently is NOT catered for. Something to mull over. #365

@masukomi
Copy link
Contributor Author

masukomi commented Jan 8, 2023

I don't expect any more feedback on this from the intarwebs and have no plans for poking it more unless requested.

I know the JSON is valid but i'm not sure how to actually test that everything works. If you can provide me instructions on how to verify that everything is matching correctly i can put together a test file with all this stuff in it and validate it against instructions.

@boyter
Copy link
Owner

boyter commented Jan 8, 2023

If you can point me in the direction of a file, which you know the counts for I can verify myself. Otherwise adding one into https://github.com/boyter/scc/tree/master/examples/language works, as that's what I implement all the tests against.

@boyter boyter merged commit 96d41db into boyter:master Jan 10, 2023
@boyter boyter added this to Done in Release 3.2.0 Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants