Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
2ccbaba1
Kaydet (Commit)
2ccbaba1
authored
Eki 14, 2014
tarafından
Florian Apolloner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added unicode_literals to the jslexer.
This ensure that ''.join(c) in jslex.py always returns text.
üst
4443c6f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
jslex.py
django/utils/jslex.py
+1
-0
test_jslex.py
tests/utils_tests/test_jslex.py
+2
-1
No files found.
django/utils/jslex.py
Dosyayı görüntüle @
2ccbaba1
"""JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from
__future__
import
unicode_literals
import
re
...
...
tests/utils_tests/test_jslex.py
Dosyayı görüntüle @
2ccbaba1
# -*- coding: utf-8 -*-
"""Tests for jslex."""
# originally from https://bitbucket.org/ned/jslex
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
django.utils.jslex
import
JsLexer
,
prepare_js_for_gettext
...
...
@@ -10,7 +11,7 @@ class JsTokensTest(TestCase):
LEX_CASES
=
[
# ids
(
"a ABC $ _ a123"
,
[
"id a"
,
"id ABC"
,
"id $"
,
"id _"
,
"id a123"
]),
(
r"\u1234 abc\u0020 \u0065_\u0067"
,
[
r"id \u1234"
,
r"id abc\u0020"
,
r"id \u0065_
\u0067"
]),
(
"
\\
u1234 abc
\\
u0020
\\
u0065_
\\
u0067"
,
[
"id
\\
u1234"
,
"id abc
\\
u0020"
,
"id
\\
u0065_
\
\
u0067"
]),
# numbers
(
"123 1.234 0.123e-3 0 1E+40 1e1 .123"
,
[
"dnum 123"
,
"dnum 1.234"
,
"dnum 0.123e-3"
,
"dnum 0"
,
"dnum 1E+40"
,
"dnum 1e1"
,
"dnum .123"
]),
(
"0x1 0xabCD 0XABcd"
,
[
"hnum 0x1"
,
"hnum 0xabCD"
,
"hnum 0XABcd"
]),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment