From 7c4d262fb8d7e532c0cd96eee4b321418e7b3522 Mon Sep 17 00:00:00 2001 From: moculus Date: Wed, 1 Oct 2008 22:15:52 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- mode/awk.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mode/awk.py b/mode/awk.py index 427206a..24a453b 100644 --- a/mode/awk.py +++ b/mode/awk.py @@ -17,11 +17,18 @@ class AwkGrammar(Grammar): PatternRule(r'awk_global', r'(?:TEXTDOMAIN|SUBSEP|RLENGTH|RSTART|RT|RS|PROCINFO|ORS|OFS|OFMT|NR|NF|LINT|IGNORECASE|FS|FNR|FILENAME|FIELDWIDTHS|ERRNO|ENVIRON|CONVFMT|BINMODE|ARGV|ARGIND|ARGC)(?![a-zA-Z0-9_])'), PatternRule(r'delimiter', r'(?:[\{\}()\[\]?:;,\$]|=(?!=)|\+=|-=|\*=|/=|\%=|\^=)'), PatternRule(r'keyword', r'(?:if|else|while|do|for|break|continue|delete|exit|close|getline|nextfile|next|printf|print|system|fflush|atan2|cos|exp|int|log|rand|sin|sqrt|srand|asorti|asort|gensub|gsub|index|length|match|split|sprintf|strtonum|substr|sub|tolower|toupper|mktime|strftime|systime|and|compl|lshift|or|xor|rshift|bindtextdomain|dcgettext|dcngettext|function|extension)(?![a-zA-Z0-9_])'), + + PatternRule(r'number', r'-?0x[0-9A-Fa-f]+'), + PatternRule(r'number', r'-?0[0-7]*'), + PatternRule(r'number', r'-?[0-9]+\.?[0-9]*'), + PatternRule(r'number', r'-?\.[0-9]+'), + PatternRule(r'unop', r'!(?![=~])|--|\+\+'), PatternRule(r'binop', r'(?:&&|\|\||<=|>=|!=|!~|==|\^|%|[-~/+*<>])'), RegionRule(r'string', r'"', StringGrammar2, r'"'), PatternRule(r'function', r'[a-zA-Z_][a-zA-Z0-9_]*(?=\()'), PatternRule(r'identifier', r'[a-zA-Z_][a-zA-Z0-9_]*'), + PatternRule(r'cont', r'\\(?=\n)'), PatternRule(r'eol', r'\n'), ]