mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Fix syntax highlight for XML, CSS, JS (#5971)
This commit is contained in:
parent
2f1866131f
commit
4f707010df
|
@ -93,7 +93,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_SYNTAX_CSS IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_syntax_css IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD class_constructor.
|
||||
|
@ -107,8 +107,10 @@ CLASS ZCL_ABAPGIT_SYNTAX_CSS IMPLEMENTATION.
|
|||
|
||||
super->constructor( ).
|
||||
|
||||
" Initialize instances of regular expression
|
||||
" Reset indicator for multi-line comments
|
||||
CLEAR gv_comment.
|
||||
|
||||
" Initialize instances of regular expression
|
||||
add_rule( iv_regex = c_regex-keyword
|
||||
iv_token = c_token-keyword
|
||||
iv_style = c_css-keyword ).
|
||||
|
|
|
@ -63,7 +63,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_SYNTAX_JS IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_syntax_js IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD class_constructor.
|
||||
|
@ -77,8 +77,10 @@ CLASS ZCL_ABAPGIT_SYNTAX_JS IMPLEMENTATION.
|
|||
|
||||
super->constructor( ).
|
||||
|
||||
" Initialize instances of regular expression
|
||||
" Reset indicator for multi-line comments
|
||||
CLEAR gv_comment.
|
||||
|
||||
" Initialize instances of regular expression
|
||||
add_rule( iv_regex = c_regex-keyword
|
||||
iv_token = c_token-keyword
|
||||
iv_style = c_css-keyword ).
|
||||
|
|
|
@ -48,8 +48,10 @@ CLASS zcl_abapgit_syntax_xml IMPLEMENTATION.
|
|||
|
||||
super->constructor( ).
|
||||
|
||||
" Initialize instances of regular expressions
|
||||
" Reset indicator for multi-line comments
|
||||
CLEAR gv_comment.
|
||||
|
||||
" Initialize instances of regular expressions
|
||||
add_rule( iv_regex = c_regex-xml_tag
|
||||
iv_token = c_token-xml_tag
|
||||
iv_style = c_css-xml_tag
|
||||
|
|
|
@ -14,7 +14,8 @@ CLASS ltcl_abapgit_syntax_xml DEFINITION FINAL FOR TESTING
|
|||
empty_attributes FOR TESTING RAISING cx_static_check,
|
||||
open_tags FOR TESTING RAISING cx_static_check,
|
||||
attributes_only FOR TESTING RAISING cx_static_check,
|
||||
attribute_value_equal_signs FOR TESTING RAISING cx_static_check.
|
||||
attribute_value_equal_signs FOR TESTING RAISING cx_static_check,
|
||||
multi_line_comments FOR TESTING RAISING cx_static_check.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
|
@ -98,7 +99,6 @@ CLASS ltcl_abapgit_syntax_xml IMPLEMENTATION.
|
|||
&& |<span class="attr_val">"1.5"</span>|
|
||||
act = mo_cut->process_line( |<ECTD SAPRL="751" VERSION="1.5"| ) ).
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD attribute_value_equal_signs.
|
||||
|
@ -114,6 +114,20 @@ CLASS ltcl_abapgit_syntax_xml IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD multi_line_comments.
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = |<span class="comment"><!-- comment</span>|
|
||||
act = mo_cut->process_line( |<!-- comment| ) ).
|
||||
|
||||
" New instance (i.e. different file)
|
||||
CREATE OBJECT mo_cut.
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = |<span class="xml_tag"><tag></span>|
|
||||
act = mo_cut->process_line( |<tag>| ) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user