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

fix warnings issue #1 [Textpow 1.3.1] warning on bad unicode syntax #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ having <tt>name="text.string", position=10</tt> and the second having
* parse text plist files {example}[https://raw.github.com/kangax/textmate-js-language-syntax-file/master/JavaScript.plist]
* update more languages via github urls

== Examples of uses

* Textpow is used by the Ultraviolet gem
http://rubygems.org/gems/ultraviolet

* The Ultraviolet gem is used by the Redmine_ultraviolet plugin
https://github.com/jbbarth/redmine_ultraviolet

With Redmine, Textpow warnings still exist when Rails is launched :
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we need these warnings in details :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, especially if we fix them :-)


/home/projets/redmine/trunk/plugins/redmine_ultraviolet/lib/uv_syntax_highlighting.rb:5: warning: already initialized constant CUSTOM_FIELD_NAME
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: invalid back reference: /\\(\n\d+|\k\w+|(?<!\|)\g\w+)/
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: invalid subexp call: /\\(\n\d+|\k\w+|(?<!\|)\g\w+)/
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: character class has ']' without escape
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: character class has ']' without escape
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: character class has ']' without escape
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: character class has ']' without escape
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: character class has ']' without escape
/var/lib/gems/1.9.1/gems/textpow-1.3.1/lib/textpow/syntax.rb:120: warning: character class has ']' without escape

== LICENSE: MIT

* Copyright (c) 2011 {Michael Grosser}[http://github.com/grosser]
Expand Down
2 changes: 1 addition & 1 deletion lib/textpow/syntax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def parse_regex(value)
end

def parse_regex_with_invalid_chars(value)
Regexp.new(value.force_encoding('UTF-8'))
Regexp.new(value.force_encoding('UTF-8'), nil, 'n')
rescue RegexpError => e
if e.message =~ /UTF-8/ or e.message =~ /invalid multibyte escape/
puts "Ignored utf8 regex error #{$!}"
Expand Down
4 changes: 2 additions & 2 deletions lib/textpow/syntax/source.camlp4.ocaml.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ patterns:
endCaptures:
"1":
name: punctuation.definition.camlp4-stream.ocaml
begin: (\[<)(?=.*?>])
begin: (\[<)(?=.*?>\])
beginCaptures:
"1":
name: punctuation.definition.camlp4-stream.ocaml
end: (?=>])
patterns:
- include: "#camlpppp-streams"
- name: punctuation.definition.camlp4-stream.ocaml
match: \[<|>]
match: \[<|>\]
- name: keyword.other.camlp4.ocaml
match: \bparser\b|<(<|:)|>>|\$(:|\${0,1})
foldingStopMarker: (\bEND\b)
2 changes: 1 addition & 1 deletion lib/textpow/syntax/source.ocaml.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ patterns:
endCaptures:
"1":
name: punctuation.definition.camlp4-stream.ocaml
begin: (?=(\[<)(?![^\[]+?[^>]]))
begin: (?=(\[<)(?![^\[]+?[^>\]]))
end: (>])
patterns:
- include: source.camlp4.ocaml
Expand Down
6 changes: 3 additions & 3 deletions lib/textpow/syntax/text.bbcode.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ patterns:
contentName: markup.underline.link.bbcode
end: (\[/)(?i:url)(\])
patterns:
- match: "[\\[]]+"
- match: "[\\[\\]]+"
- name: meta.link.inline.bbcode
captures:
"0":
Expand All @@ -236,7 +236,7 @@ patterns:
contentName: markup.underline.link.email.bbcode
end: (\[/)(?i:email)(\])
patterns:
- match: "[\\[]]+"
- match: "[\\[\\]]+"
- name: meta.link.image.bbcode
endCaptures:
"0":
Expand All @@ -260,7 +260,7 @@ patterns:
name: punctuation.definition.tag.bbcode
end: (\[/)(?i:img)(\])
patterns:
- match: "[\\[]]+?"
- match: "[\\[\\]]+?"
- name: constant.other.smiley.bbcode
captures:
"3":
Expand Down
2 changes: 1 addition & 1 deletion lib/textpow/syntax/text.html.asp.net.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ repository:
- include: source.asp.vb.net
tag-generic-attribute:
name: entity.other.attribute-name.html
match: \b([a-zA-Z-:]+)
match: \b([a-zA-Z\-:]+)
ruby:
name: source.ruby.embedded.html
endCaptures:
Expand Down
2 changes: 1 addition & 1 deletion lib/textpow/syntax/text.html.mt.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ repository:
- include: "#entities"
tag-generic-attribute:
name: entity.other.attribute-name.html
match: \b([a-zA-Z-_:]+)
match: \b([a-zA-Z\-_:]+)
ruby:
name: source.ruby.embedded.html
captures:
Expand Down
2 changes: 1 addition & 1 deletion lib/textpow/syntax/text.html.strict.active4d.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ repository:
- include: "#embedded-code"
tag-generic-attribute:
name: entity.other.attribute-name.html
match: \b([a-zA-Z-:]+)
match: \b([a-zA-Z\-:]+)
string-single-quoted-js:
name: string.quoted.single.js
endCaptures:
Expand Down
2 changes: 1 addition & 1 deletion lib/textpow/syntax/text.html.tt.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ repository:
captures:
"2":
name: punctuation.separator.key-value.tt
match: \b([a-zA-Z-_:]+)\s*(=)
match: \b([a-zA-Z\-_:]+)\s*(=)
keyword:
name: string.unquoted.tt
match: \b([A-Za-z0-9_]+)
Expand Down
2 changes: 1 addition & 1 deletion lib/textpow/syntax/text.html.twiki.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ repository:
name: punctuation.definition.link.twiki
"5":
name: string.other.link.title.twiki
match: (\[)([^]]*)(\]) *(\[)(.*?)(\])
match: (\[)([^\]]*)(\]) *(\[)(.*?)(\])
numlist-paragraph:
patterns:
- name: markup.list.numbered.paragraph
Expand Down
4 changes: 2 additions & 2 deletions lib/textpow/syntax/text.html.xhtml.1-strict.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ repository:
patterns:
- include: source.css
- name: invalid.illegal.char_not_allowed
match: <|>|]]>|--
match: <|>|\]\]>|--
- include: "#entities"
- include: source.css
- name: meta.tag.meta.style.html
Expand Down Expand Up @@ -1044,7 +1044,7 @@ repository:
patterns:
- include: source.js
- name: invalid.illegal.char_not_allowed
match: <|>|]]>|--
match: <|>|\]\]>|--
- include: "#entities"
- include: source.js
- name: meta.tag.block.script.html
Expand Down
2 changes: 1 addition & 1 deletion lib/textpow/syntax/text.restructuredtext.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repository:
name: punctuation.definition.directive.restructuredtext
"2":
name: punctuation.separator.key-value.restructuredtext
match: (\.\.)\s[A-z][A-z0-9-_]+(::)\s*$
match: (\.\.)\s[A-z][A-z0-9\-_]+(::)\s*$
comment: directives
- name: meta.raw.block.restructuredtext
captures:
Expand Down
6 changes: 3 additions & 3 deletions lib/textpow/syntax/text.tex.latex.sweave.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ fileTypes:
- Rnw
- snw
- rnw
firstLineMatch: ^\\documentclass(?!.*\{beamer\})|^<<(.?*)>>=$
firstLineMatch: ^\\documentclass(?!.*\{beamer\})|^<<(.*)>>=$
scopeName: text.tex.latex.sweave
uuid: 1F450973-8259-4BA2-A754-48C634561A13
foldingStartMarker: ^<<(.?*)>>=|\\begin\{.*\}
foldingStartMarker: ^<<(.*)>>=|\\begin\{.*\}
patterns:
- name: meta.block.parameters.sweave
endCaptures:
Expand Down Expand Up @@ -80,5 +80,5 @@ patterns:
patterns:
- include: source.r
- include: text.tex.latex
foldingStopMarker: ^@(.?*)$|\\end\{.*\}
foldingStopMarker: ^@(.*)$|\\end\{.*\}
keyEquivalent: ^~S