[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-450-g67fb010
Mildred Ki'Lya
silkensedai at online.fr
Mon Aug 24 20:15:32 UTC 2009
The following commit has been merged in the master branch:
commit 67fb010a02c27bef13f3f2a51a6a5f355062e884
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date: Mon Aug 24 19:58:55 2009 +0200
Update Kate syntax file
diff --git a/editor/kate/lisaac_v2.xml b/editor/kate/lisaac_v2.xml
index 71014e3..55335e4 100644
--- a/editor/kate/lisaac_v2.xml
+++ b/editor/kate/lisaac_v2.xml
@@ -46,6 +46,7 @@
<!ENTITY op_char "[&op_char_list;]">
<!ENTITY escape_char "([\\][tbnfrva0?\\ ]|&numeric_escape;|\\|)">
<!ENTITY identifier "(&lower_case;(&lower_case;|&decimal_digit;|_)*)">
+ <!ENTITY not_identifier "([^a-z0-9_])">
<!ENTITY ws "([\s])">
<!ENTITY ws_opt "&ws;*">
<!--oom = one or more-->
@@ -54,7 +55,8 @@
il faudra mettre la regle d'affectation avant -->
<!ENTITY operator "&op_char;+">
<!ENTITY affect "(:=|<-|[?]=)">
- <!ENTITY cap_identifier "&upper_case;(&upper_case;|&decimal_digit;|_)*">
+ <!ENTITY cap_idf_item "&upper_case;(&upper_case;|&decimal_digit;|_)*">
+ <!ENTITY cap_identifier "&cap_idf_item;(\.&cap_idf_item;)*(\.(\.&cap_idf_item;)+)?">
<!ENTITY external "\`(&normal_char;|&escape_char;)*\`">
<!ENTITY external_start "\`">
<!ENTITY priority "(Left|Right)">
@@ -556,13 +558,13 @@
</context>
<!--#################################################################
- PROTOTYPE -> cap_identifier['['TYPE_LIST {identifier TYPE_LIST} ']']
+ PROTOTYPE -> cap_identifier['('TYPE_LIST {identifier TYPE_LIST} ')']
___
PROTOTYPE -> cap_identifier GENERIC_TYPE {cap_identifier}
- GENERIC_TYPE -> lambda {si pas de '['}
- GENERIC_TYPE -> '['GENERIC_TYPE_LIST']' {'['}
+ GENERIC_TYPE -> lambda {si pas de '('}
+ GENERIC_TYPE -> '['GENERIC_TYPE_LIST']' {'('}
GENERIC_TYPE_LIST -> TYPE_LIST GENERIC_TYPE_LIST_FOLLOWING {start_type}
- GENERIC_TYPE_LIST_FOLLOWING -> lambda {']'}
+ GENERIC_TYPE_LIST_FOLLOWING -> lambda {')'}
GENERIC_TYPE_LIST_FOLLOWING -> 'identifier TYPE_LIST GENERIC_TYPE_LIST_FOLLOWING {identifier}
################################################################# -->
<context name="header_prototype" fallthrough="true" fallthroughContext="error">
@@ -570,7 +572,7 @@
<StringDetect String="Section" lookAhead="true" context="#pop" />
<RegExpr String="&cap_identifier;" context="#stay" attribute="header_type" />
- <DetectChar char="[" lookAhead="true" context="header_generic_type" />
+ <DetectChar char="(" lookAhead="true" context="header_generic_type" />
<RegExpr String="&following_prototype;" lookAhead="true" context="#pop" />
</context>
@@ -578,7 +580,7 @@
<IncludeRules context="comments_and_spaces" />
<RegExpr String="&cap_identifier;" context="#stay" attribute="type" />
- <DetectChar char="[" lookAhead="true" context="generic_type" />
+ <DetectChar char="(" lookAhead="true" context="generic_type" />
<RegExpr String="&following_prototype;" lookAhead="true" context="#pop" />
</context>
@@ -586,14 +588,14 @@
<context name="header_generic_type" fallthrough="true" fallthroughContext="error">
<IncludeRules context="comments_and_spaces" />
- <DetectChar char="[" context="header_generic_type_list" attribute="header_generic_type_bracket" />
- <DetectChar char="]" context="#pop" attribute="header_generic_type_bracket" />
+ <DetectChar char="(" context="header_generic_type_list" attribute="header_generic_type_bracket" />
+ <DetectChar char=")" context="#pop" attribute="header_generic_type_bracket" />
</context>
<context name="generic_type" fallthrough="true" fallthroughContext="error">
<IncludeRules context="comments_and_spaces" />
- <DetectChar char="[" context="generic_type_list" attribute="generic_type_bracket" />
- <DetectChar char="]" context="#pop" attribute="generic_type_bracket" />
+ <DetectChar char="(" context="generic_type_list" attribute="generic_type_bracket" />
+ <DetectChar char=")" context="#pop" attribute="generic_type_bracket" />
</context>
<context name="header_generic_type_list" fallthrough="true" fallthroughContext="error">
@@ -602,7 +604,7 @@
<!--on rajoute following_type_list pour eviter de boucler dans le cas où un truc
commencant comme un type mais faisant parti de following_type_list est trouvé avant "]".
l'erreur sera trouvée après.-->
- <RegExpr String="(\]|&following_type_list;)" lookAhead="true" context="#pop" />
+ <RegExpr String="(\)|&following_type_list;)" lookAhead="true" context="#pop" />
<RegExpr String="&start_type;" lookAhead="true" context="header_type_list" />
<RegExpr String="&identifier;" lookAhead="true" context="generic_type_list_following" />
@@ -614,7 +616,7 @@
<!--on rajoute following_type_list pour eviter de boucler dans le cas où un truc
commencant comme un type mais faisant parti de following_type_list est trouvé avant "]".
l'erreur sera trouvée après.-->
- <RegExpr String="(\]|&following_type_list;)" lookAhead="true" context="#pop" />
+ <RegExpr String="(\)|&following_type_list;)" lookAhead="true" context="#pop" />
<RegExpr String="&start_type;" lookAhead="true" context="type_list" />
<RegExpr String="&identifier;" lookAhead="true" context="generic_type_list_following" />
@@ -624,7 +626,7 @@
<context name="generic_type_list_following" fallthrough="true" fallthroughContext="error">
<IncludeRules context="comments_and_spaces" />
- <DetectChar char="]" lookAhead="true" context="#pop" />
+ <DetectChar char=")" lookAhead="true" context="#pop" />
<RegExpr String="&identifier;" context="type_list" attribute="identifier_separating_types" />
</context>
@@ -727,7 +729,7 @@
<IncludeRules context="comments_and_spaces" />
<RegExpr String="Old" context="expr" attribute="lisaac_keyword" />
- <RegExpr String="&start_send_msg;" lookAhead="true" context="send_msg" />
+ <RegExpr String="&start_send_msg;" lookAhead="true" context="send_msg_implicit" />
<!-- mise de expr_primary après à cause des ident qui
commencent comme des chiffres hexa -->
<RegExpr String="&start_expr_primary;" lookAhead="true" context="expr_primary" />
@@ -761,7 +763,7 @@
___
EXPR_PRIMARY -> PROTOTYPE {cap_identifier}
- EXPR_PRIMARY -> external[':'['(']TYPE['('{TYPE','}TYPE')'][')']]
+ EXPR_PRIMARY -> external[':'['(']TYPE['{'{TYPE','}TYPE'}'][')']]
___
EXPR_PRIMARY -> external EXPR_PRIMARY1 {external}
EXPR_PRIMARY_EXTERNAL_CAST -> lambda {'.', operator, ';', '}', ')' }
@@ -876,7 +878,7 @@
<context name="expr_primary_external_main_type" fallthrough="true" fallthroughContext="error">
<IncludeRules context="comments_and_spaces" />
- <RegExpr String="&start_type;(&start_type;|\[|\]|&ws;)*[(]" lookAhead="true" context="expr_primary_external_main_type_with_sub_types" />
+ <RegExpr String="&start_type;(&start_type;|\(|\)|&ws;)*[{]" lookAhead="true" context="expr_primary_external_main_type_with_sub_types" />
<RegExpr String="&start_type;" lookAhead="true" context="type" />
<RegExpr String="(&identifier;|&operator;|[;)}])" lookAhead="true" context="#pop" />
@@ -886,9 +888,9 @@
<IncludeRules context="comments_and_spaces" />
<RegExpr String="&start_type;" lookAhead="true" context="type" />
- <DetectChar char="(" context="expr_primary_external_sub_types" attribute="parenthesis_surrounding_cast_subtypes" />
+ <DetectChar char="{" context="expr_primary_external_sub_types" attribute="parenthesis_surrounding_cast_subtypes" />
- <DetectChar char=")" context="#pop#pop" attribute="parenthesis_surrounding_cast_subtypes" />
+ <DetectChar char="}" context="#pop#pop" attribute="parenthesis_surrounding_cast_subtypes" />
</context>
<context name="expr_primary_external_sub_types" fallthrough="true" fallthroughContext="error">
@@ -897,7 +899,7 @@
<RegExpr String="&start_type;" lookAhead="true" context="type" />
<DetectChar char="," context="#stay" attribute="comma_separating_types" />
- <DetectChar char=")" lookAhead="true" context="#pop" />
+ <DetectChar char="}" lookAhead="true" context="#pop" />
</context>
@@ -1030,7 +1032,7 @@
<context name="send_msg_args" fallthrough="true" fallthroughContext="error">
<IncludeRules context="comments_and_spaces" />
- <RegExpr String="&identifier;" context="send_msg_args_following" attribute="argument_identifier" />
+ <RegExpr String="&identifier;" context="send_msg_args_following" attribute="argument_identifier" />
<RegExpr String="&start_expr_primary;" lookAhead="true" context="send_msg_args_following" />
</context>
@@ -1045,6 +1047,77 @@
</context>
+
+
+
+
+ <context name="send_msg_implicit" fallthrough="true" fallthroughContext="error">
+ <IncludeRules context="comments_and_spaces" />
+
+ <RegExpr String="&identifier;" lookAhead="true" context="send_msg_implicit_ident" />
+
+ <RegExpr String="&following_send_msg;" lookAhead="true" context="#pop" />
+ </context>
+
+ <context name="send_msg_implicit_ident" fallthrough="true" fallthroughContext="error">
+ <IncludeRules context="comments_and_spaces" />
+ <!-- test if there is arguments to the message or not. If not, we call send_msg_implicit_ident_stop,
+ else we call send_msg_implicit_ident_cont. In the case we don't know (because there are
+ comments or new lines between the slot name and the following thing) we guess it is a slot
+ without arguments because it is rare to put extra things between a slot name and its argument
+ but it is more common to put variables (slots without arguments) at the end of a list, with the
+ list ending the following line -->
+
+ <RegExpr String="&identifier;&ws_opt;(&ws;&identifier;|&start_expr_primary;)" context="send_msg_implicit_ident_cont" lookAhead="true" />
+
+ <RegExpr String="&identifier;&ws_opt;(&following_send_msg;)" context="send_msg_implicit_ident_stop" lookAhead="true" />
+
+ <RegExpr String="&identifier;" context="send_msg_implicit_switch_param_or_not" attribute="called_variable_name_implicit"/>
+ </context>
+
+ <context name="send_msg_implicit_ident_stop" fallthrough="true" fallthroughContext="error">
+ <IncludeRules context="comments_and_spaces" />
+
+ <RegExpr String="&identifier;" context="#pop#pop" attribute="called_variable_name_implicit" />
+ </context>
+
+ <context name="send_msg_implicit_ident_cont" fallthrough="true" fallthroughContext="error">
+ <IncludeRules context="comments_and_spaces" />
+
+ <RegExpr String="&identifier;" context="send_msg_implicit_switch_param_or_not" attribute="called_slot_name_implicit" />
+ </context>
+
+ <context name="send_msg_implicit_switch_param_or_not" fallthrough="true" fallthroughContext="error">
+ <IncludeRules context="comments_and_spaces" />
+
+ <RegExpr String="(&identifier;|&start_expr_primary;)" lookAhead="true" context="send_msg_implicit_args" />
+
+ <RegExpr String="&following_send_msg;" lookAhead="true" context="#pop#pop#pop" />
+ </context>
+
+ <context name="send_msg_implicit_with_args" fallthrough="true" fallthroughContext="error">
+ <RegExpr String="&identifier;" context="send_msg_implicit_args" attribute="called_slot_name_implicit" />
+
+ <RegExpr String="&following_send_msg;" lookAhead="true" context="#pop" />
+ </context>
+
+ <context name="send_msg_implicit_args" fallthrough="true" fallthroughContext="error">
+ <IncludeRules context="comments_and_spaces" />
+
+ <RegExpr String="&identifier;" context="send_msg_implicit_args_following" attribute="argument_identifier_implicit" />
+ <RegExpr String="&start_expr_primary;" lookAhead="true" context="send_msg_implicit_args_following" />
+ </context>
+
+ <context name="send_msg_implicit_args_following" fallthrough="true" fallthroughContext="error">
+ <IncludeRules context="comments_and_spaces" />
+
+ <RegExpr String="&start_expr_primary;" lookAhead="true" context="expr_primary" />
+
+ <RegExpr String="&identifier;" context="#pop" attribute="called_slot_keyword_implicit" />
+
+ <RegExpr String="&following_send_msg;" lookAhead="true" context="#pop#pop" />
+ </context>
+
<!--######################################################-->
<context name="comments_and_spaces" fallthrough="true" fallthroughContext="#pop">
<!--support des commentaires, et vidage des espaces et autres tabulations-->
@@ -1149,10 +1222,14 @@
<itemData name="lisaac_keyword" defStyleNum="dsNormal" />
<itemData name="caller_identifier" defStyleNum="dsNormal" color="#0000C0" />
- <itemData name="called_slot_name" defStyleNum="dsNormal" color="darkblue" bold="1" italic="1" />
- <itemData name="called_slot_keyword" defStyleNum="dsNormal" color="black" italic="1" />
- <itemData name="identifier_separating_types" defStyleNum="dsNormal" color="black" italic="1" />
- <itemData name="argument_identifier" defStyleNum="dsNormal" color="#0000C0" />
+ <itemData name="called_slot_name" defStyleNum="dsNormal" color="#0000C0" />
+ <itemData name="called_slot_name_implicit" defStyleNum="dsNormal" color="#0000C0" />
+ <itemData name="called_slot_variable_name_implicit" defStyleNum="dsNormal" color="black" italic="1" />
+ <itemData name="called_slot_keyword" defStyleNum="dsNormal" color="#0000C0" />
+ <itemData name="called_slot_keyword_implicit" defStyleNum="dsNormal" color="#0000C0" />
+ <itemData name="identifier_separating_types" defStyleNum="dsNormal" color="black" italic="1" />
+ <itemData name="argument_identifier" defStyleNum="dsNormal" color="black" italic="1" />
+ <itemData name="argument_identifier_implicit" defStyleNum="dsNormal" color="black" italic="1" />
<itemData name="c_variable" defStyleNum="dsNormal" color="blue" bold="1" />
<itemData name="comment" defStyleNum="dsComment" color="darkgreen" italic="1" />
--
Lisaac compiler
More information about the Lisaac-commits
mailing list