mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user