Skip to content

Commit df393a0

Browse files
Tyillildude
authored andcommitted
Add Pod 6 to the languages.yml (#4083)
* Add pod6 to the languages.yml * Add tm_source to pod6 language entry * Updated grammar list * Add heuristics for pod vs pod6 * Add a language_id for Pod6 * Rename 'Pod6' to 'Pod 6' * Update the grammar list * Set Pod 6 ace_mode to 'perl' instead of 'perl6' to pass test * Add sample for Pod 6 * Update heuristics to use Pod 6 instead of Perl 6 * Remove .pod6 as a Pod 6 extension * Extend Pod 6 heuristics Both "=begin pod" and "=comment" are Pod 6 unique constructs. As such, these can be used to differentiate between Pod and Pod 6. * Merge two regexes in one for Pod 6 heuristics * Update whitespace match to match all whitespace except newlines * Remove excessive = * Add sample POD file for heuristics test * Update Pod 6 heuristics to default to Pod * Update Pod 6 heuristics
1 parent aae48b5 commit df393a0

5 files changed

Lines changed: 841 additions & 0 deletions

File tree

lib/linguist/heuristics.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,16 @@ def call(data)
380380
end
381381
end
382382

383+
disambiguate ".pod" do |data|
384+
if /^\s*\/\* XPM \*\//.match(data)
385+
Language["XPM"]
386+
elsif /^[\s&&[^\n]]*=(comment|begin pod|begin para|item\d+)/.match(data)
387+
Language["Pod 6"]
388+
else
389+
Language["Pod"]
390+
end
391+
end
392+
383393
disambiguate ".pro" do |data|
384394
if /^[^\[#]+:-/.match(data)
385395
Language["Prolog"]

lib/linguist/languages.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3495,6 +3495,16 @@ Pod:
34953495
- perl
34963496
tm_scope: none
34973497
language_id: 288
3498+
Pod 6:
3499+
type: prose
3500+
ace_mode: perl
3501+
tm_scope: source.perl6fe
3502+
wrap: true
3503+
extensions:
3504+
- ".pod"
3505+
interpreters:
3506+
- perl6
3507+
language_id: 155357471
34983508
PogoScript:
34993509
type: programming
35003510
color: "#d80074"

0 commit comments

Comments
 (0)