Add numeric patterns
This commit is contained in:
parent
231b09ed29
commit
619b8b57af
80
minizinc.iro
80
minizinc.iro
@ -78,53 +78,9 @@ contexts [] {
|
|||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
main : context {
|
main : context {
|
||||||
|
#######################################
|
||||||
: pattern {
|
## Comment Patterns
|
||||||
regex \= $${__MY_CONSTANT}
|
#######################################
|
||||||
styles [] = .keyword;
|
|
||||||
}
|
|
||||||
|
|
||||||
: include "numeric" ;
|
|
||||||
|
|
||||||
: inline_push {
|
|
||||||
regex \= (\{)
|
|
||||||
styles [] = .punctuation;
|
|
||||||
: pop {
|
|
||||||
regex \= (\})
|
|
||||||
styles [] = .punctuation;
|
|
||||||
}
|
|
||||||
: include "main" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
: pattern {
|
|
||||||
regex \= (;)
|
|
||||||
styles [] = .punctuation;
|
|
||||||
}
|
|
||||||
|
|
||||||
: inline_push {
|
|
||||||
regex \= (\")
|
|
||||||
styles [] = .punctuation;
|
|
||||||
default_style = .text
|
|
||||||
: pop {
|
|
||||||
regex \= (\")
|
|
||||||
styles [] = .punctuation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
: inline_push {
|
|
||||||
regex \= (\()
|
|
||||||
styles [] = .punctuation;
|
|
||||||
: pop {
|
|
||||||
regex \= (\))
|
|
||||||
styles [] = .punctuation;
|
|
||||||
}
|
|
||||||
: include "numeric" ;
|
|
||||||
: pattern {
|
|
||||||
regex \= (,)
|
|
||||||
styles [] = .punctuation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
: include "multi_line_comment";
|
: include "multi_line_comment";
|
||||||
|
|
||||||
: pattern {
|
: pattern {
|
||||||
@ -132,10 +88,10 @@ main : context {
|
|||||||
styles [] = .comment;
|
styles [] = .comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
: pattern {
|
#######################################
|
||||||
regex \= ([^\s])
|
## Literal Patterns
|
||||||
styles [] = .illegal;
|
#######################################
|
||||||
}
|
: include "numeric";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,11 +105,33 @@ main : context {
|
|||||||
|
|
||||||
numeric : context {
|
numeric : context {
|
||||||
: pattern {
|
: pattern {
|
||||||
|
description = integer number
|
||||||
regex \= (\b\d+)
|
regex \= (\b\d+)
|
||||||
styles [] = .numeric;
|
styles [] = .numeric;
|
||||||
}
|
}
|
||||||
|
: pattern {
|
||||||
|
description = octal integer number
|
||||||
|
regex \= (\b0o[0-7]+)
|
||||||
|
styles [] = .numeric;
|
||||||
|
}
|
||||||
|
: pattern {
|
||||||
|
description = hexadecimal number
|
||||||
|
regex \= (\b0x[0-9A-Fa-f]+)
|
||||||
|
styles [] = .numeric;
|
||||||
|
}
|
||||||
|
: pattern {
|
||||||
|
description = hexadecimal number
|
||||||
|
regex \= (\b0x[0-9A-Fa-f]+)
|
||||||
|
styles [] = .numeric;
|
||||||
|
}
|
||||||
|
: pattern {
|
||||||
|
description = floating point number
|
||||||
|
regex \= (\b\d+(.\d+|(.\d+)?[Ee][-+]?\d+))
|
||||||
|
styles [] = .numeric, .numeric, .numeric;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
## Multi Line Comment Context
|
## Multi Line Comment Context
|
||||||
###########################################
|
###########################################
|
||||||
|
Reference in New Issue
Block a user