diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-07-31 16:44:38 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-07-31 16:44:38 (GMT) |
commit | 206e6223447359bb13b59843f4f1ac983ccb1bd8 (patch) | |
tree | 45a497d8ab26e492207d1bdfc210aed996284a8b /ds9/parsers/threedsendlex.tcl | |
parent | 181b2ca19e96b8c77cddfeef756f9564c34148be (diff) | |
download | blt-206e6223447359bb13b59843f4f1ac983ccb1bd8.zip blt-206e6223447359bb13b59843f4f1ac983ccb1bd8.tar.gz blt-206e6223447359bb13b59843f4f1ac983ccb1bd8.tar.bz2 |
update all parsers to accept british spelling of COLOUR
Diffstat (limited to 'ds9/parsers/threedsendlex.tcl')
-rw-r--r-- | ds9/parsers/threedsendlex.tcl | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/ds9/parsers/threedsendlex.tcl b/ds9/parsers/threedsendlex.tcl index 4aa36b5..1d714d1 100644 --- a/ds9/parsers/threedsendlex.tcl +++ b/ds9/parsers/threedsendlex.tcl @@ -253,83 +253,90 @@ set VIEW_ 267 set yyleng [string length $yytext] set matched_rule 5 } - # rule 6: compass - if {[regexp -start $index_ -indices -line -nocase -- {\A(compass)} $yy_current_buffer match] > 0 && \ + # rule 6: colour + if {[regexp -start $index_ -indices -line -nocase -- {\A(colour)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 6 } - # rule 7: el - if {[regexp -start $index_ -indices -line -nocase -- {\A(el)} $yy_current_buffer match] > 0 && \ + # rule 7: compass + if {[regexp -start $index_ -indices -line -nocase -- {\A(compass)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 7 } - # rule 8: elevation - if {[regexp -start $index_ -indices -line -nocase -- {\A(elevation)} $yy_current_buffer match] > 0 && \ + # rule 8: el + if {[regexp -start $index_ -indices -line -nocase -- {\A(el)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 8 } - # rule 9: highlite - if {[regexp -start $index_ -indices -line -nocase -- {\A(highlite)} $yy_current_buffer match] > 0 && \ + # rule 9: elevation + if {[regexp -start $index_ -indices -line -nocase -- {\A(elevation)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 9 } - # rule 10: lock - if {[regexp -start $index_ -indices -line -nocase -- {\A(lock)} $yy_current_buffer match] > 0 && \ + # rule 10: highlite + if {[regexp -start $index_ -indices -line -nocase -- {\A(highlite)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 10 } - # rule 11: method - if {[regexp -start $index_ -indices -line -nocase -- {\A(method)} $yy_current_buffer match] > 0 && \ + # rule 11: lock + if {[regexp -start $index_ -indices -line -nocase -- {\A(lock)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 11 } - # rule 12: scale - if {[regexp -start $index_ -indices -line -nocase -- {\A(scale)} $yy_current_buffer match] > 0 && \ + # rule 12: method + if {[regexp -start $index_ -indices -line -nocase -- {\A(method)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 12 } - # rule 13: view - if {[regexp -start $index_ -indices -line -nocase -- {\A(view)} $yy_current_buffer match] > 0 && \ + # rule 13: scale + if {[regexp -start $index_ -indices -line -nocase -- {\A(scale)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 13 } - # rule 14: vp - if {[regexp -start $index_ -indices -line -nocase -- {\A(vp)} $yy_current_buffer match] > 0 && \ + # rule 14: view + if {[regexp -start $index_ -indices -line -nocase -- {\A(view)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 14 } - # rule 15: \s - if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ + # rule 15: vp + if {[regexp -start $index_ -indices -line -nocase -- {\A(vp)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 15 } - # rule 16: . - if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + # rule 16: \s + if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 16 } + # rule 17: . + if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 17 + } if {$matched_rule == -1} { set yytext [string index $yy_current_buffer $index_] set yyleng 1 @@ -361,36 +368,39 @@ return $BORDER_ return $COLOR_ } 6 { -return $COMPASS_ +return $COLOR_ } 7 { -return $EL_ +return $COMPASS_ } 8 { return $EL_ } 9 { -return $HIGHLITE_ +return $EL_ } 10 { -return $LOCK_ +return $HIGHLITE_ } 11 { -return $METHOD_ +return $LOCK_ } 12 { -return $SCALE_ +return $METHOD_ } 13 { -return $VIEW_ +return $SCALE_ } 14 { return $VIEW_ } 15 { -# ignore whitespace +return $VIEW_ } 16 { +# ignore whitespace + } + 17 { set yylval $yytext; return $yylval } default |