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

Add support for Rouge #3

Open
buildersbrewery opened this issue Jan 2, 2016 · 1 comment
Open

Add support for Rouge #3

buildersbrewery opened this issue Jan 2, 2016 · 1 comment

Comments

@buildersbrewery
Copy link
Owner

add support for https://github.com/jneen/rouge

@buildersbrewery buildersbrewery changed the title Add support for https://github.com/jneen/rouge Add support for Rouge Jan 2, 2016
@buildersbrewery buildersbrewery self-assigned this Jan 22, 2016
@buildersbrewery
Copy link
Owner Author

buildersbrewery commented Feb 4, 2017

# -*- coding: utf-8 -*- #

module Rouge
  module Lexers
    class LSL < RegexLexer
      title 'LSL'
      desc 'LSL (https://wiki.secondlife.com/wiki/LSL_Portal)'
      tag 'lsl'
      filenames '*.lsl'

      state :base do
        rule %r(//.*$), Comment::Single
        rule %r(/\*), Comment::Multiline, :multiline_comment
        rule %r("), Str::Double, :escape_dqs
      end

      state :multiline_comment do
        rule %r(\*/), Comment::Multiline, :pop!
      end

      state :escape_dqs do
        mixin :string_escape
        mixin :dqs
      end

      state :string_escape do
        rule %r(\\([\\"nt])), Str::Escape
      end

      state :dqs do
        rule %r("), Str::Double, :pop!
      end
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant