Skip to content

Commit

Permalink
Add Pod 6 to the languages.yml (#4083)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Tyil authored and lildude committed May 2, 2018
1 parent aae48b5 commit df393a0
Show file tree
Hide file tree
Showing 5 changed files with 841 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/linguist/heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ def call(data)
end
end

disambiguate ".pod" do |data|
if /^\s*\/\* XPM \*\//.match(data)
Language["XPM"]
elsif /^[\s&&[^\n]]*=(comment|begin pod|begin para|item\d+)/.match(data)
Language["Pod 6"]
else
Language["Pod"]
end
end

disambiguate ".pro" do |data|
if /^[^\[#]+:-/.match(data)
Language["Prolog"]
Expand Down
10 changes: 10 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3495,6 +3495,16 @@ Pod:
- perl
tm_scope: none
language_id: 288
Pod 6:
type: prose
ace_mode: perl
tm_scope: source.perl6fe
wrap: true
extensions:
- ".pod"
interpreters:
- perl6
language_id: 155357471
PogoScript:
type: programming
color: "#d80074"
Expand Down
Loading

0 comments on commit df393a0

Please sign in to comment.