f20080305d
Определение специфических рекомендаций (матрица профилей §8):
1. Ж/д слой (закрыт мёртвый railway ×2.5 у РАС):
- /api/v1/water/{case_id} отдаёт railway=rail как LineString
(без service/industrial/military веток), кэш общий v2;
- railway_warning «перекрыть/проверить немедленно» по профилям;
- SearchMap: Polyline слой ж/д (тёмно-красный), счётчики 💧/🚂.
2. cant_swim → профиль не_умеет_плавать (water ×3.0, без изменения
радиуса, critical_warning «обследовать водоёмы НЕМЕДЛЕННО»):
- раньше чекбокс влиял только на текст, в скоринге был пробел;
- derive в analyze._derive_profiles — работает и для closed_cases.
3. unmodeled_profiles: ДЦП/слабое зрение/слух — честная пометка
«вне поведенческой модели» с пояснением (vector_tasks B12:
профили без аналога не выдавать за учтённые); блок на фронте
в карточке здоровья.
Площадь воды: сферический эксцесс, проверен на квадрате 53° (744017 м²
vs 743272 точного). Тесты: 202 passed (новый test_cant_swim_profile).
67 lines
1.9 KiB
Python
67 lines
1.9 KiB
Python
"""
|
|
pygments.lexers.x10
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
Lexers for the X10 programming language.
|
|
|
|
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
|
:license: BSD, see LICENSE for details.
|
|
"""
|
|
|
|
from pygments.lexer import RegexLexer
|
|
from pygments.token import Text, Comment, Keyword, String
|
|
|
|
__all__ = ['X10Lexer']
|
|
|
|
|
|
class X10Lexer(RegexLexer):
|
|
"""
|
|
For the X10 language.
|
|
"""
|
|
|
|
name = 'X10'
|
|
url = 'http://x10-lang.org/'
|
|
aliases = ['x10', 'xten']
|
|
filenames = ['*.x10']
|
|
mimetypes = ['text/x-x10']
|
|
version_added = '2.2'
|
|
|
|
keywords = (
|
|
'as', 'assert', 'async', 'at', 'athome', 'ateach', 'atomic',
|
|
'break', 'case', 'catch', 'class', 'clocked', 'continue',
|
|
'def', 'default', 'do', 'else', 'final', 'finally', 'finish',
|
|
'for', 'goto', 'haszero', 'here', 'if', 'import', 'in',
|
|
'instanceof', 'interface', 'isref', 'new', 'offer',
|
|
'operator', 'package', 'return', 'struct', 'switch', 'throw',
|
|
'try', 'type', 'val', 'var', 'when', 'while'
|
|
)
|
|
|
|
types = (
|
|
'void'
|
|
)
|
|
|
|
values = (
|
|
'false', 'null', 'self', 'super', 'this', 'true'
|
|
)
|
|
|
|
modifiers = (
|
|
'abstract', 'extends', 'implements', 'native', 'offers',
|
|
'private', 'property', 'protected', 'public', 'static',
|
|
'throws', 'transient'
|
|
)
|
|
|
|
tokens = {
|
|
'root': [
|
|
(r'[^\S\n]+', Text),
|
|
(r'//.*?\n', Comment.Single),
|
|
(r'/\*[\s\S]*?\*/', Comment.Multiline),
|
|
(r'\b({})\b'.format('|'.join(keywords)), Keyword),
|
|
(r'\b({})\b'.format('|'.join(types)), Keyword.Type),
|
|
(r'\b({})\b'.format('|'.join(values)), Keyword.Constant),
|
|
(r'\b({})\b'.format('|'.join(modifiers)), Keyword.Declaration),
|
|
(r'"(\\\\|\\[^\\]|[^"\\])*"', String),
|
|
(r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char),
|
|
(r'.', Text)
|
|
],
|
|
}
|