update of old PL/SQL PLpgSQL and SQLPL patch based on current version

see [linguist] add support for oracle PLSQL (#1003)
This commit is contained in:
David Pyke Le Brun
2015-02-06 13:36:40 +00:00
parent 6d770ab68f
commit 3e54d6651c
22 changed files with 1213 additions and 0 deletions

View File

@@ -223,5 +223,30 @@ module Linguist
Language["Text"]
end
end
disambiguate "PLSQL", "SQLPL", "PLpgSQL", "SQL" do |data|
match = nil
#unique keywords for each language
plpgsqlkeywords = [/^\\i\b/i, /begin ?(work|transaction)?;/i , /AS \$\$/i, /RAISE EXCEPTION/i, /LANGUAGE plpgsql\b/i ]
plsqlkeywords = [ /pragma\b/i , /constructor\W+function\b/i]
#sqlplkeywords = [ ]
#common keywords that are not SQL
plkeywords = [/begin\b/i,/boolean\b/i, /package\b/i,/exception\b/i, /^end;\b/i ]
re = Regexp.union(plpgsqlkeywords)
if data.match(re)
match = Language["PLpgSQL"]
else
re = Regexp.union(plsqlkeywords)
if data.match(re)
match= Language["PLSQL"]
else
re = Regexp.union(plkeywords)
match= Language["SQL"] if ! data.match(re)
end
end
match
end
end
end

View File

@@ -2145,6 +2145,26 @@ PHP:
aliases:
- inc
#Oracle
PLSQL:
type: programming
ace_mode: sql
tm_scope: Oracle
extensions:
- .pls
- .pkb
- .pks
- .plb
- .sql
#Postgres
PLpgSQL:
type: programming
ace_mode: pgsql
tm_scope: source.sql
extensions:
- .sql
Pan:
type: programming
color: '#cc0000'
@@ -2675,6 +2695,15 @@ SQL:
- .udf
- .viw
#IBM DB2
#SQLPL:
#type: programming
#ace_mode: sql
#tm_scope: source.sql
#extensions:
#- .sql
#- .db2
STON:
type: data
group: Smalltalk