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

Lexer datastudio #1453

Merged
merged 8 commits into from
Mar 31, 2020
Prev Previous commit
Next Next commit
do not put errors in multi-line strings
  • Loading branch information
BastienDurel committed Mar 6, 2020
commit 7fefd005574e872218b7c05df110c270a10b997c
12 changes: 6 additions & 6 deletions lib/rouge/lexers/datastudio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ class Datastudio < RegexLexer

state :string do
rule %r/%(\\.|.)+?%/, Str::Escape
rule %r/"/, Str, :pop!
rule %r/./, Str
rule %r/"/, Str::Double, :pop!
rule %r/.|\n/, Str::Double
BastienDurel marked this conversation as resolved.
Show resolved Hide resolved
end

state :string_s do
rule %r/%(\\.|.)+?%/, Str::Escape
rule %r/'/, Str, :pop!
rule %r/./, Str
rule %r/'/, Str::Single, :pop!
rule %r/.|\n/, Str::Single
end

state :root do
Expand All @@ -114,8 +114,8 @@ class Datastudio < RegexLexer
rule %r/@#{id}(\.#{id})?/m, Name::Entity
rule %r/%(\\.|.)+?%/, Name::Variable
rule %r/[~!%^&*()+=|\[\]{}:;,.<>\/?-]/, Punctuation
rule %r/"(\\.|.|\n)*?/, Str, :string
rule %r/'(\\.|.|\n)*?/, Str, :string_s
rule %r/"/, Str::Double, :string
rule %r/'/, Str::Single, :string_s
rule %r(
[0-9]
([.][0-9]*)? # decimal
Expand Down